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

Throw errors, not strings #514

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open

Conversation

and3k5
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).

@lovasoa
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
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?

@and3k5
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
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
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants