replace reportWarning with reportError