PYRS logo PYRS

Diagnostics and Tracebacks

Edit this page

Syntax and runtime diagnostic behavior in PYRS tracebacks.

PYRS emits CPython-shaped traceback output for syntax and runtime failures, including source context and caret spans where source location data is available.

Runtime Traceback Shape

Element Behavior
Frame linesFile … , line N, in … style output with ordered frame stack.
Source contextSource line and caret span render when location text is available.
Exception footerTyped footer formatting follows CPython conventions (including key exception text behaviors).
Cause/context chainDirect cause and context sections are emitted in CPython-style traceback chaining flow.

Syntax Diagnostics

Syntax Diagnostics Example
>>> def broken( ... pass File "<stdin>", line 2 pass ^^^^ SyntaxError: invalid syntax

Parser and semantic syntax failures are surfaced as SyntaxError-style diagnostics with file/line context and CPython-oriented message classes.

Error-Report Expectations

  • Unhandled exceptions should preserve original exception type, not wrap traceback text in a new runtime error.
  • Re-raised exceptions should preserve traceback-chain fidelity for the original fault context.
  • Diff tests are used to keep traceback shape aligned with CPython behavior over time.