Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Error handling improvements #125

Merged
merged 5 commits into from
Aug 9, 2021
Merged

Commits on Jul 8, 2021

  1. More consistent error handling

    - Remove Error.Delegate
    - Skip JVM stack trace handling
    - Consistent formatting of raw delegate errors and regular positioned errors
    szeiger committed Jul 8, 2021
    Configuration menu
    Copy the full SHA
    d2db368 View commit details
    Browse the repository at this point in the history
  2. Unify error stack trace handling

    Instead of sprinkling error propagation with or without stack frames all over the Evaluator and other parts of the codebase, we now do it in one place (visitExpr) with additional logic in Error.withStackFrame. Duplicate frames are skipped, an error without any stack frame always gets the current position, and all other frames are added or skipped depending on the Expr at the position.
    szeiger committed Jul 8, 2021
    Configuration menu
    Copy the full SHA
    718d24e View commit details
    Browse the repository at this point in the history

Commits on Jul 10, 2021

  1. Add expression types to stack traces

    This makes stack traces much more descriptive. We also change some of the reported positions / expr types to better match the semantics of the errors.
    szeiger committed Jul 10, 2021
    Configuration menu
    Copy the full SHA
    e3f3edd View commit details
    Browse the repository at this point in the history
  2. Consistent treatment of parse errors

    They are reported as sjsonnet.ParseError with normal stack traces instead of the previous one-liners which required customized error messages for parse errors in imported files. Errors are now stored as Error objects instead of Strings in the parse cache. This paves the way for error reporting during static evaluation and it is already required now to translate the paths in parse error stack traces to a different base directory (when reusing a cached parse error from a previous run).
    szeiger committed Jul 10, 2021
    Configuration menu
    Copy the full SHA
    2a7e493 View commit details
    Browse the repository at this point in the history
  3. Static errors for unknown variables

    Unknown variables and illegal self/super/$ references are now checked statically as they are supposed to be. Error messages are consistent with Google Jsonnet's.
    Fixes databricks#122
    szeiger committed Jul 10, 2021
    Configuration menu
    Copy the full SHA
    d516b17 View commit details
    Browse the repository at this point in the history