class Novika::Error
- Novika::Error
- Exception
- Reference
- Object
Overview
Holds and accepts information about an error.
Errors are raised when a certain case is undesired, unhandleable, or otherwise inappropriate to some form of computation.
Errors can be handled and unhandled. Unhandled errors
generate an error #report
(generally to STDERR, but this
depends on the frontend). They are fatal for the program
they occur in.
Death handlers, or death traps, when set up in code blocks
and/or their relatives, allow errors to be handled. For this
reason, errors are Novika Form
s, and can be manipulated,
reported, and inspected from Novika.
Included Modules
Defined in:
novika/error.crConstant Summary
-
MAX_TRACE =
64
-
How many trace entries to display at max.
Constructors
Class Method Summary
Instance Method Summary
-
#conts : Block | Nil
Holds a reference to the continuations block at the time of death.
-
#conts=(conts : Block | Nil)
Holds a reference to the continuations block at the time of death.
-
#desc(io : IO)
Appends a string description of this form to io.
-
#details : String
Returns a string describing the reasons of this error.
-
#form : Form
Returns the form that (speculatively) caused this error.
-
#form? : Form | Nil
Returns the form that (speculatively) caused this error.
-
#report(io : IO)
Reports about this error to io.
- #to_s(io)
Instance methods inherited from module Novika::Form
a(type : T.class) : T forall T
a,
desc(io : IO)desc : String desc, die(details : String) die, effect(io)
effect effect, on_open(engine : Engine) : self on_open, on_parent_open(engine : Engine) : self on_parent_open, onto(block : Block) : self onto, sel(a, b) sel, to_quote : Quote to_quote
Instance methods inherited from module Novika::Schedulable
schedule(engine : Engine, stack : Block)
schedule,
schedule!(engine : Engine, stack : Block)
schedule!
Constructor Detail
Class Method Detail
Instance Method Detail
Holds a reference to the continuations block at the time of death.
Appends a string description of this form to io.
Reports about this error to io.
Note: Colorize is used for colors and emphasis. If you
do not want Colorize in io, you can temporarily disable
it by setting Colorize.enabled = false
.