Using PB 2017 R3, Postgresql 11
Want to display better error message(s) to users, when error(s) returned by database. All users can't understand message(s) like Primary key violation, check constraint error, Unique key violation etc..
Currently I used to display the error message and error code, returned by the database. It starts with
SQLState = P0001
ERROR: Partially Paid. Cannot Delete...; Error while executing the query;
No Changes Made to Database;
Update test_table SET Code = '100' where Code = '200'
This error message says something, as it's raised using RAISE EXCEPTION in a trigger. For Primary Key Violations, Unique Key Violation.. and for others, we may not get such messages.
How such messages could be translated that's understandable to the users?
Currently I display it in the DBError event itself. But this blocks other users, in multi-user environment, from proceeding till this messagebox is closed.
Would like to have your advice regarding the displaying the error messages in a better way and the place (event) where it could be displayed.