BadScript 2
Loading...
Searching...
No Matches
BadScript2.Common.BadParseException Class Referenceabstract

Base Class for all BadScript Parser Exceptions. More...

Inheritance diagram for BadScript2.Common.BadParseException:
BadScript2.Common.BadScriptException BadScript2.Parser.BadParserException BadScript2.Reader.BadSourceReaderException

Protected Member Functions

 BadParseException (string message, BadSourcePosition position)
 Constructor for the BadParseException.
 
 BadParseException (string message, BadSourcePosition position, Exception inner)
 Constructor for the BadParseException.
 
- Protected Member Functions inherited from BadScript2.Common.BadScriptException
 BadScriptException (string message)
 
 BadScriptException (string message, string originalMessage)
 
 BadScriptException (string message, string originalMessage, Exception inner)
 
 BadScriptException (string message, string originalMessage, BadSourcePosition position)
 
 BadScriptException (string message, string originalMessage, BadSourcePosition position, Exception inner)
 

Static Private Member Functions

static string GetMessage (string message, BadSourcePosition position)
 Returns a string that represents the error message with the source position.
 

Additional Inherited Members

- Properties inherited from BadScript2.Common.BadScriptException
string OriginalMessage [get]
 The Original Error Message.
 
BadSourcePositionPosition [get]
 The source position of where the error occurred.
 

Detailed Description

Base Class for all BadScript Parser Exceptions.

Definition at line 6 of file BadParseException.cs.

Constructor & Destructor Documentation

◆ BadParseException() [1/2]

BadScript2.Common.BadParseException.BadParseException ( string  message,
BadSourcePosition  position 
)
protected

Constructor for the BadParseException.

Parameters
messageThe Exception Message
positionThe source position of where the error occurred

Definition at line 13 of file BadParseException.cs.

13 : base(
14 GetMessage(message, position),
15 message,
16 position
17 ) { }
static string GetMessage(string message, BadSourcePosition position)
Returns a string that represents the error message with the source position.

◆ BadParseException() [2/2]

BadScript2.Common.BadParseException.BadParseException ( string  message,
BadSourcePosition  position,
Exception  inner 
)
protected

Constructor for the BadParseException.

Parameters
messageThe Exception Message
positionThe source position of where the error occurred
innerThe Inner Exception

Definition at line 26 of file BadParseException.cs.

26 : base(
27 GetMessage(message, position),
28 message,
29 position,
30 inner
31 ) { }

Member Function Documentation

◆ GetMessage()

static string BadScript2.Common.BadParseException.GetMessage ( string  message,
BadSourcePosition  position 
)
staticprivate

Returns a string that represents the error message with the source position.

Parameters
messageThe message
positionThe source position
Returns
String representation

Definition at line 40 of file BadParseException.cs.

41 {
42 return $"{message} at {position.GetExcerpt(10, 10)} in {position.GetPositionInfo()}";
43 }

The documentation for this class was generated from the following file: