-
Notifications
You must be signed in to change notification settings - Fork 1.1k
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
Conversation
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
Makes sense.
Would it be possible to make a prerelease of some sort which includes this? Or is it too far in time?
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
commented
Oct 4, 2024
Definitely a good way to incorporate the behaviour keeping it optional and eventually making it the default whenever a major bump is planned.
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).