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

Closed
opened 7 years ago by jking · 0 comments
jking commented 7 years ago
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 7 years ago
jking added this to the 0.1.0 milestone 7 years ago
Sign in to join this conversation.
No Milestone
No Assignees
1 Participants
Notifications
Due Date

No due date set.

Dependencies

This issue currently doesn't have any dependencies.

Loading…
There is no content yet.