Adding an error code to the parse error

SyntaxEditor for WPF Forum

Posted 4 years ago by Daisuke Nakada
Version: 17.2.0664


For adding an error, I'm calling the ReportError method on IParseError within the grammar callbacks like this:

state.ReportError(ParseErrorLevel.Error, ERROR_MESSAGE, errorToken);


I want to have "error code" in addition to error level and description.

And later I want to retrieve error level, description, and error code and show them on my original error list window.


I would like to know what is the best way to do this.

I couldn't find error code property in the IParseError interface.


Thank you.

Comments (2)

Posted 4 years ago by Actipro Software Support - Cleveland, OH, USA


Our default ParseError class that implements IParseError doesn't have an error code, but you could make a class that inherits ParseError and add ErrorCode yourself to it.  Then just call the state.ReportError overload that takes an IParseError.

Actipro Software Support

Posted 4 years ago by Daisuke Nakada

Thank you.

The latest build of this product (v22.1.3) was released 29 days ago, which was after the last post in this thread.

Add Comment

Please log in to a validated account to post comments.