Skip to content
This repository was archived by the owner on Sep 7, 2023. It is now read-only.
This repository was archived by the owner on Sep 7, 2023. It is now read-only.

Align Ergo throw/enforce errors with the standard Accord Project Error hierarchy #755

@jeromesimeon

Description

@jeromesimeon

Is your feature request related to a problem? Please describe.
When a clause throws an error (either through an enforce expression or as an explicit throw in the logic), that error is caught after logic execution and turned into a low-level JavaScript error with a string.

It would be nice if the error being thrown in JavaScript was made part of the standard Accord Project error model (see https://docs.accordproject.org/docs/ref-errors.html).

The code is currently located in the Ergo runtime here:

function unwrapError(result) {

Describe the solution you'd like
A new kind of Accord Project exception for Logic errors (LogicException ?) in https://docs.accordproject.org/docs/ref-errors.html.

Change the runtime behaviour to raise one of those.

Maybe better location information, and details notably for enforce exceptions.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions