Any way to seperate constraint errors

The forum for ZeosLib 7.2 Report problems. Ask for help, post proposals for the new version and Zeoslib 7.2 features here. This is a forum that will be edited once the 7.2.x version goes into RC/stable!!

My personal intention for 7.2 is to speed up the internals as optimal a possible for all IDE's. Hope you can help?! Have fun with testing 7.2
Post Reply
IbeDBob
Junior Boarder
Junior Boarder
Posts: 47
Joined: 27.05.2010, 21:04

Any way to seperate constraint errors

Post 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.
Thanks

Dyslexic Bob
marsupilami
Platinum Boarder
Platinum Boarder
Posts: 1939
Joined: 17.01.2011, 14:17

Re: Any way to seperate constraint errors

Post 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.
IbeDBob
Junior Boarder
Junior Boarder
Posts: 47
Joined: 27.05.2010, 21:04

Re: Any way to seperate constraint errors

Post 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. :)
Thanks

Dyslexic Bob
Post Reply