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

Meaningless error code [error messages] #366

Closed
screendriver opened this issue Oct 19, 2015 · 7 comments
Closed

Meaningless error code [error messages] #366

screendriver opened this issue Oct 19, 2015 · 7 comments

Comments

@screendriver
Copy link

I am getting wrong respectively meaningless error messages in my error callback. For example: I made a typo in my insert statement: INSERTt into.... Usually I get a syntax error in SQLite but in this cordova plugin I get a {message: prepare statement failed with error: 1, code: 0}. I can't really see what's going wrong. Same for not null constraints that must be fulfilled.

@brodycj
Copy link
Contributor

brodycj commented Oct 19, 2015

The message indicates to me that you are using the Android version. In this case, the sqlite error code is simply included within the error message.

@screendriver
Copy link
Author

Yes, I am using the Android version. Hmm the only thing I get is {message: prepare statement failed with error: 1, code: 0}. So I have to check the error code and compare it with SQLite Result Codes?

And why it tells me error: 1 but code: 0? By the way: SQLite Result Codes seems a little bit to generic.

@brodycj brodycj changed the title Meaningless error messages Meaningless error code [error messages] Oct 19, 2015
@brodycj
Copy link
Contributor

brodycj commented Oct 19, 2015

The error code member is bogus on the Android and Windows platforms, marked in README.md.

@screendriver
Copy link
Author

Hmm ok. So there is no way to indicate what error exactly occurred?

@brodycj
Copy link
Contributor

brodycj commented Oct 19, 2015

I will look into it later this week. According to the Web SQL spec code should be 5 in case of a syntax error or 6 in case of a constraint violation.

@screendriver
Copy link
Author

Ok thank you.

brodycj pushed a commit to brodycj/cordova-sqlite-evplus-ext-legacy-build-free-dev that referenced this issue Oct 27, 2015
@brodycj
Copy link
Contributor

brodycj commented Sep 1, 2016

This is now fixed in the default branch of this project as described in #121. This is still an issue for Windows (#539) to be fixed in the near future. The fixes will be propagated to the evcore and future (non-legacy) evplus versions.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants