Uploaded image for project: 'RAML Module Builder'
  1. RAML Module Builder
  2. RMB-622

PgExceptionUtil.getMessage: Compose a message of all PgException fields.

    XMLWordPrintable

Details

    • 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

      TestRail: Results

        Attachments

          Activity

            People

              julianladisch Julian Ladisch
              julianladisch Julian Ladisch
              Votes:
              0 Vote for this issue
              Watchers:
              1 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved:

                TestRail: Runs

                  TestRail: Cases