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

refactor(core): simplify error handling #10297

Merged
merged 6 commits into from
Apr 22, 2021
Merged

Conversation

AaronO
Copy link
Contributor

@AaronO AaronO commented Apr 21, 2021

This PR simplifies error handling in core.js. v8 builtin errors are registered by default so new runtimes no longer need to bootstrap with:

Deno.core.registerErrorClass('Error', Error);

One less gotcha when bootstrapping runtimes

Changes

  • register builtin v8 errors in core.js so consumers don't have to
  • remove complexity of error args handling
    (consumers must provide a constructor with custom args, core simply provides msg arg)
  • Adapt 99_main.js
  • Adapt other runtimes

- `core.js`: register builtin v8 errors in core.js so consumers don't have to
- `core.js`: remove complexity of error args handling (consumers must provide a constructor with custom args, core simply provides msg arg)
Since Error and other builtin error classes are now bootstrapped by core.js
Copy link
Member

@ry ry left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM 👍

@ry ry merged commit ff9ff4a into denoland:main Apr 22, 2021
@AaronO AaronO deleted the core/simplify-errors branch April 22, 2021 06:28
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants