class ErrorResponse extends PGMessage {

    public static ErrorResponse loadFromPacket(byte[] packet) {
        PGProto proto = new PGProto(packet, 5);
        Map<Byte, String> fieldWithValue = new LinkedHashMap<>();
        while (proto.hasRemaining()) {
            byte field = proto.readByte();
            if (field != 0x00) {
                fieldWithValue.put(field, proto.readNullStr());
            }
        }
        return new ErrorResponse(fieldWithValue);
    }

    public  ErrorResponse(Severity severity, String sqlState, String message, String file,
        String line, String routine);
    public  ErrorResponse(Severity severity, String sqlState, String message);
    public  ErrorResponse(String sqlState, String message);
    private  ErrorResponse(Map<Byte, String> fieldWithValue);

}