ErrorResponse packet

An ErrorResponse packet is sent by the server to indicate that something went wrong.

Methods

  • List<ErrorField> getErrorFields() : gets all the error fields in the packet. Each ErrorField has methods byte getFieldType() and void setFieldType(byte), and String getFieldValue() and void setFieldValue(String). Note that this list can be modified -- you can add and remove members, and change individual error fields.

  • String getErrorString() : returns a string made up of all the error fields in the packet, separated by commas. This can be useful for logging and debugging.

  • void addErrorField(byte fieldType, String fieldValue) : adds a new ErrorField to the list.

The meaning of the field type is described in the Postgres documentation.