Skip to content
This repository has been 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

Open
jeromesimeon opened this issue Apr 13, 2020 · 0 comments

Comments

@jeromesimeon
Copy link
Member

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.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant