Catch SQLite exceptions before they cascade up to Database callers #46

Closed
opened 2017-03-06 18:07:12 -05:00 by jking · 0 comments
Owner

The SQLite extension implements exception-based error reporting via the generic Exception class, which makes it difficult to differentiate error generated by the SQLite engine from general PHP errors when dealing with a deep call stack. It would make more sense to catch errors/exceptions within the driver class and send back various types of custom SQL exceptions (syntax error, constraint failure, timeout, whatever).

Moreover, PostgresSQL does not have a class-based PHP interface and does not throw exceptions; an engine abstraction for exceptions is therefore necessary in the long term.

The SQLite extension implements exception-based error reporting via the generic Exception class, which makes it difficult to differentiate error generated by the SQLite engine from general PHP errors when dealing with a deep call stack. It would make more sense to catch errors/exceptions within the driver class and send back various types of custom SQL exceptions (syntax error, constraint failure, timeout, whatever). Moreover, PostgresSQL does not have a class-based PHP interface and does not throw exceptions; an engine abstraction for exceptions is therefore necessary in the long term.
jking closed this issue 2017-03-08 12:29:31 -05:00
jking added this to the 0.1.0 milestone 2017-08-30 08:30:58 -04:00
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference: MensBeam/Arsse#46
No description provided.