Page 1 of 1

Any way to seperate constraint errors

Posted: 19.02.2016, 14:22
by IbeDBob
Squlite and I have two constraints, UNIQUE and CHECK RANGE.

Is there any way to get an error number for the specific error when using try/except/end.

All I get is "SQL Error: Constraint failed" and I'd like to let the user know specifically, what just went wrong.

Re: Any way to seperate constraint errors

Posted: 19.02.2016, 20:42
by marsupilami
Hello Bob - I am not sure. Maybe you should look into the code, how SQLite returns errors. If SQLite gives some kind of an error number you could easily create a kinda SQLiteException that could have an additional property for that error number.

Re: Any way to seperate constraint errors

Posted: 23.02.2016, 14:05
by IbeDBob
Thanks, thought I would ask here first, but decided to handle the issue myself before Post. More coding, but more control. I guess I was being lazy. :)