scenic.core.errors
Common exceptions and error handling.
Summary of Module Members
Module Attributes
Verbosity level. |
|
Whether or not to include Scenic's innards in backtraces. |
|
Whether or not to do post-mortem debugging of uncaught exceptions. |
|
Whether or not to do "post-mortem" debugging of rejected scenes/simulations. |
|
Folders elided from backtraces when |
Functions
Call the given function, starting the Scenic backtrace at that point. |
|
Print a Scenic exception, cleaning up the traceback if desired. |
|
|
|
Attempt to recover the text of an error from the original Scenic file. |
|
|
|
|
|
|
|
Configure Scenic's debugging options. |
Exceptions
Parse error occuring during modification of the Python AST. |
|
Error for scenarios with inconsistent requirements. |
|
Error raised for syntactically-valid but otherwise problematic Scenic programs. |
|
Error occurring during Scenic/Python parsing or compilation. |
|
Error occuring during Python compilation of translated Scenic code. |
|
An error produced during Scenic compilation, scene generation, or simulation. |
|
Error occuring during Scenic parsing or compilation. |
|
An error produced by attempting to parse an invalid Scenic program. |
|
Error for illegal uses of specifiers. |
Member Details
- setDebuggingOptions(*, verbosity=0, fullBacktrace=False, debugExceptions=False, debugRejections=False)[source]
Configure Scenic’s debugging options.
- Parameters:
verbosity (int) – Verbosity level. Zero by default, although the command-line interface uses 1 by default. See the
--verbosity
option for the allowed values.fullBacktrace (bool) – Whether to include Scenic’s innards in backtraces (like the
-b
command-line option).debugExceptions (bool) – Whether to use
pdb
for post-mortem debugging of uncaught exceptions (like the--pdb
option).debugRejections (bool) – Whether to enter
pdb
when a scene or simulation is rejected (like the--pdb-on-reject
option).
- verbosityLevel = 0
Verbosity level. See
--verbosity
for the allowed values.
- showInternalBacktrace = False
Whether or not to include Scenic’s innards in backtraces.
Set to True by default so that any errors during import of the scenic module will get full backtraces; the
scenic
module’s __init__.py sets it to False.
- postMortemDebugging = False
Whether or not to do post-mortem debugging of uncaught exceptions.
- postMortemRejections = False
Whether or not to do “post-mortem” debugging of rejected scenes/simulations.
Folders elided from backtraces when
showInternalBacktrace
is false.
- exception ScenicError[source]
Bases:
Exception
An error produced during Scenic compilation, scene generation, or simulation.
- exception ScenicSyntaxError[source]
Bases:
ScenicError
An error produced by attempting to parse an invalid Scenic program.
This is intentionally not a subclass of SyntaxError so that pdb can be used for post-mortem debugging of the parser. Our custom excepthook below will arrange to still have it formatted as a SyntaxError, though.
- exception ParseCompileError(exc)[source]
Bases:
ScenicSyntaxError
Error occurring during Scenic/Python parsing or compilation.
- exception ScenicParseError(exc)[source]
Bases:
ParseCompileError
Error occuring during Scenic parsing or compilation.
- exception PythonCompileError(exc)[source]
Bases:
ParseCompileError
Error occuring during Python compilation of translated Scenic code.
- exception ASTParseError(node, message, filename)[source]
Bases:
ScenicSyntaxError
Parse error occuring during modification of the Python AST.
- exception InvalidScenarioError[source]
Bases:
ScenicError
Error raised for syntactically-valid but otherwise problematic Scenic programs.
- exception InconsistentScenarioError(line, message)[source]
Bases:
InvalidScenarioError
Error for scenarios with inconsistent requirements.
- exception SpecifierError[source]
Bases:
ScenicError
Error for illegal uses of specifiers.
- displayScenicException(exc, seen=None)[source]
Print a Scenic exception, cleaning up the traceback if desired.
If
showInternalBacktrace
is False, this hides frames inside Scenic itself.