Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Throw errors, not strings #514

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

Open
and3k5 wants to merge 2 commits into sql-js:master
base: master
Choose a base branch
Loading
from and3k5:throw-errors
Open

Conversation

Copy link

@and3k5 and3k5 commented Jun 1, 2022

Throwing strings makes it difficult to debug for specific issues when working on projects that use sql.js.
Replaced string with Errors when being thrown. (Really just using a constructor around the string).

Copy link
Member

lovasoa commented Jun 1, 2022

This would be a good thing in theory, but it would require a major version bump. Maybe we can include that when we need to break backwards compatibility anyway

and3k5 and stefnotch reacted with thumbs up emoji

Copy link
Author

and3k5 commented Jun 2, 2022

Makes sense.

Would it be possible to make a prerelease of some sort which includes this? Or is it too far in time?

Copy link
Author

and3k5 commented Jun 7, 2022

Another suggestion:
Can me make a change where we make a global switch to change how errors are thrown?

Something like

const initSqlJs = require('sql.js');
initSqlJs.throwAsErrors = true;
sunnykgupta reacted with rocket emoji

Copy link

Definitely a good way to incorporate the behaviour keeping it optional and eventually making it the default whenever a major bump is planned.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Reviewers
No reviews
Assignees
No one assigned
Labels
None yet
Projects
None yet
Milestone
No milestone
Development

Successfully merging this pull request may close these issues.

AltStyle によって変換されたページ (->オリジナル) /