crow/exception.crow
(source)
ignore-exceptions
record
nominal
with-block
[t
] t
?
(anonymous
ignore-exceptions
, f
mut
t
(void
))
todo
record
exception
variant-member
exception
variant-membershow
string
(anonymous
todo
)
not-implemented
record
exception
variant-member
exception
variant-membershow
string
(anonymous
not-implemented
)
show
string
(a
exception-and-backtrace
) unsafe
Outputs the exception's message and backtrace to a string.
force
[t
] t
(a
(t
, exception-and-backtrace
) result
)
exception
variant
Describes the reason there is a 'throw'.
For common exceptions, see exception.crow
.
This does not include a backtrace; see 'exception-and-backtrace' for that.
This is a variant type, meaning anything can declare a variant-member
that is an exception.
exception-and-backtrace
record
(has non-public fields)
exception
exception
Type of a thrown exception.
There is no exception subtyping in crow, so all exceptions have this type.
error
record
exception
variant-member
exception
variant-membershow
string
Thrown when an exception is not specified in an 'assert' or 'forbid'.
catch-all
[t
] (t
, exception-and-backtrace
) result
(tried
mut
t
(void
))
threw-non-exception
record
exception
variant-member
exception
variant-memberthrown
js-any
This can only happen in JS
show
string
(a
threw-non-exception
)
unreachable
[t
] t
() bare
Fail unconditionally.
This function is used to mark part of an if
or match
that should not be possible.
rethrow
[t
] t
(e
exception-and-backtrace
) bare
Throw an existing exception object.
This is useful for rethrowing an exception that was already caught.
Throwing an exception does not modify its backtrace.