sql.js
sql.js copied to clipboard
Throw errors, not strings
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).
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;