abstract class Pegasus::Error::PegasusException

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

Defined in:

pegasus/error.cr

Constructors

Instance Method Summary

Constructor Detail

def self.new(description : String, context_data : Array(Pegasus::Error::ErrorContext) = [] of ErrorContext, internal : Bool = false) #

[View source]

Instance Method Detail

def context_data : Array(ErrorContext) #

[View source]
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.


[View source]
def print(io) #

Prints the exception to the given IO.


[View source]
def print_extra(io) #

Prints the context that the exception has attached.


[View source]