Class TokenMgrError
Token Manager Error.
Implements
Inherited Members
Namespace: Lucene.Net.QueryParsers.Classic
Assembly: Lucene.Net.QueryParser.dll
Syntax
[Serializable]
public class TokenMgrError : Exception, ISerializable
Constructors
TokenMgrError()
No arg constructor.
Declaration
public TokenMgrError()
TokenMgrError(bool, int, int, int, string, char, int)
Full Constructor.
Declaration
public TokenMgrError(bool eofSeen, int lexState, int errorLine, int errorColumn, string errorAfter, char curChar, int reason)
Parameters
Type | Name | Description |
---|---|---|
bool | eofSeen | |
int | lexState | |
int | errorLine | |
int | errorColumn | |
string | errorAfter | |
char | curChar | |
int | reason |
TokenMgrError(string, int)
Constructor with message and reason.
Declaration
public TokenMgrError(string message, int reason)
Parameters
Type | Name | Description |
---|---|---|
string | message | |
int | reason |
Properties
Message
You can also modify the body of this method to customize your error messages. For example, cases like LOOP_DETECTED and INVALID_LEXICAL_STATE are not of end-users concern, so you can return something like :
"Internal Error : Please file a bug report .... "
from this method for such cases in the release version of your parser.
Declaration
public override string Message { get; }
Property Value
Type | Description |
---|---|
string |
Overrides
Methods
AddEscapes(string)
Replaces unprintable characters by their escaped (or unicode escaped) equivalents in the given string
Declaration
protected static string AddEscapes(string str)
Parameters
Type | Name | Description |
---|---|---|
string | str |
Returns
Type | Description |
---|---|
string |
LexicalError(bool, int, int, int, string, char)
Returns a detailed message for the Error when it is thrown by the token manager to indicate a lexical error.
Declaration
protected static string LexicalError(bool eofSeen, int lexState, int errorLine, int errorColumn, string errorAfter, char curChar)
Parameters
Type | Name | Description |
---|---|---|
bool | eofSeen | indicates if EOF caused the lexical error |
int | lexState | lexical state in which this error occurred |
int | errorLine | line number when the error occurred |
int | errorColumn | column number when the error occurred |
string | errorAfter | prefix that was seen before this error occurred |
char | curChar | the offending character |
Returns
Type | Description |
---|---|
string | Detailed error message |
Remarks
You can customize the lexical error message by modifying this method.