Details
-
Task
-
Status: Closed (View Workflow)
-
P2
-
Resolution: Done
-
None
-
customfield_11100 35977
-
CP: sprint 88
-
1
-
Core: Platform
Description
PgException.getMessage() returns the message field only. The SQL error code, the detail message and the severity are stored in PgException but are not included in this string.
Implement PgExceptionUtil.getMessage that composes a message string of all four PgException fields.
Example output:
ErrorMessage(fields=[(Severity, ERROR), (SQLSTATE, 23505), (Message, duplicate key value violates unique constraint "t_text_key"), (Detail, Key (text)=(a) already exists.)]
This is similar to com.github.jasync.sql.db.postgresql.exceptions.GenericDatabaseException#getMessage() that returns
ErrorMessage(fields=[(Severity, ERROR), (V, ERROR), (SQLSTATE, 23505), (Message, duplicate key value violates unique constraint "t_text_key"), (Detail, Key (text)=(a) already exists.), (s, public), (t, t), (n, t_text_key), (File, nbtinsert.c), (Line, 427), (Routine, _bt_check_unique)])
This is needed for unit testing to match SQLSTATE.
Note: vertx-pg-client 4.0.0 will return all fields again, using JsonObject encoding: https://github.com/eclipse-vertx/vertx-sql-client/pull/642