Issue Details (XML | Word | Printable)

Key: CORE-1132
Type: Improvement Improvement
Status: Resolved Resolved
Resolution: Fixed
Priority: Major Major
Assignee: Dmitry Yemanov
Reporter: StudSW
Votes: 6
Watchers: 4
Operations

If you were logged in you would be able to see more operations.
Firebird Core

Exception context in PSQL exception handlers

Created: 16/Feb/07 07:44 AM   Updated: 06/Dec/16 06:42 PM
Component/s: Engine
Affects Version/s: None
Fix Version/s: 4.0 Alpha 1

QA Status: Covered by another test(s)
Test Details: See functional\exception\handling_name_and_message.fbt


 Description  « Hide
The possibility to obtain exception text or it's parts (e.g. unique contraint name, FK name, deadlock on what, etc.) increases flexibility of PSQL exception handlers.

It is useful if the procedure returns Error Codes, but no exceptions (expesially if proc cals are nested). Or, let's say, no non-fatal (e.g. contraint filure can be assumed for some cases) exceptions.
This gives unified exception handling for all "user" exceptions/

Also, commonly, to show user-friendly messages some extra queries to DB are required. Having handler on server side - it is more easy to obtain this information (or create a table for with user-messages for all UNIQUE, FOREIGN and so on)

So, the procedure can catch all self-related errors and exceptions, making its interface more exact for callers.

Also the client may stay uninvolved in the server-side processing.

Currently, any proccessing in PSQL that may throw non-user exception (e.g. constraint violation) must break its work and return exception to client-side in order to obtain the needed information about it.
So on, the name of constraint is not user-friendly (or lets say cleint-friendly) and to show a little bit useful information to user it needs to request it from server (from rdb$metadata or from applevel metadata).

So the client must be able to catch and process things which it doesn't need.

I think this improvement is needed to make stored procedures more autonomic without any need of involving client-side in "server-work".

Best regards, StudSW

 All   Comments   Change History   Subversion Commits      Sort Order: Ascending order - Click to sort in descending order
Pavel Zotov added a comment - 09/Sep/16 05:26 PM
Ticket will be closed after 'Resolved' flag will be set.