abstract class Pegasus::Error::PegasusException
- Pegasus::Error::PegasusException
- Exception
- Reference
- Object
Overview
An exception thrown by Pegasus. Unlike Crystal exceptions, which will be reported directly to the user without any prettyfication, the Pegasus exception is created to display the error information to the user in a clear and pretty way. This includes coloring and emphasizing certain sections of the message, and generally presenting them in a user-friendly way.
Direct Known Subclasses
- Pegasus::Error::DfaException
- Pegasus::Error::GeneralException
- Pegasus::Error::GrammarException
- Pegasus::Error::NfaException
- Pegasus::Error::PdaException
- Pegasus::Error::TableException
Defined in:
pegasus/error.crConstructors
Instance Method Summary
- #context_data : Array(ErrorContext)
-
#get_location_name
Get the "location" of the error, which is used to report to the user when in the process the error occured.
-
#print(io)
Prints the exception to the given IO.
-
#print_extra(io)
Prints the context that the exception has attached.
Constructor Detail
def self.new(description : String, context_data : Array(Pegasus::Error::ErrorContext) = [] of ErrorContext, internal : Bool = false)
#
Instance Method Detail
abstract
def get_location_name
#
Get the "location" of the error, which is used to report to the user when in the process the error occured.