pub struct FabError { /* private fields */ }
Expand description
This is the recommended error type for Fabparse. This can be pretty-printed with the method
print_trace(input)
, which will print a stack trace of the parsers with
some surrounding context. An example is:
Location [“”]^["a1b2c3"] from parser Repeat
Location [“a1b2”]^[“c3”] from parser RepeatIter
From cause [TryReducerFailed]
There is also a print_trace_window(input)
method that lets you customize
the context window. The default is currently 10, but Fabparse reserves the
right to increase this.
Implementations§
Trait Implementations§
Source§impl Display for FabError
This is the default error for Fabparse.
It has a method print_trace(input) which prints a stack trace of
the parser error, with context. An example trace on input “a1b2c3” is:
impl Display for FabError
This is the default error for Fabparse. It has a method print_trace(input) which prints a stack trace of the parser error, with context. An example trace on input “a1b2c3” is:
Location [“”]^["a1b2c3"] from parser Repeat
Location [“a1b2”]^[“c3”] from parser Repeat
From cause [TryReducerFailed]
This method requires that you pass in the input that generated the error. If you don’t the method may panic or print an incorrect stack trace.
This error type also has a method print_trace_window(input, window_size) which controls how much context is printed. By default, it will be 10 chars or items