Class ErrorMessage

java.lang.Object
io.confluent.kafka.schemaregistry.client.rest.entities.ErrorMessage

public class ErrorMessage extends Object
Generic JSON error message.

This is an updated version of the original io.confluent.kafka.schemaregistry.client.rest.entities.ErrorMessage class from the Confluent Schema Registry Client, which has the same structure in Java and is still fully compatible with the client code, but supports parsing the source JSON error message in more formats via Jackson annotations (see unpackNestedError(java.util.Map<java.lang.String, java.lang.Object>)).

In additional to the original error format:

   {
     "error_code": 400,
     "message": "..."
   }
 
It also supports this format:
   {
     "error: {
       "code": 400,
       "message": "..."
     }
   }
 
Since the class is in the same package io.confluent.kafka.schemaregistry.client.rest.entities, pre-pending this library to the classpath will override its implementation from the Schema Registry Client library and allow parsing Managed Kafka style error messages.
  • Constructor Details

    • ErrorMessage

      public ErrorMessage()
    • ErrorMessage

      public ErrorMessage(int errorCode, String message)
  • Method Details

    • getErrorCode

      public int getErrorCode()
    • setErrorCode

      public void setErrorCode(int errorCode)
    • getMessage

      public String getMessage()
    • setMessage

      public void setMessage(String message)
    • unpackNestedError

      public void unpackNestedError(Map<String,Object> error)
    • equals

      public boolean equals(Object o)
      Overrides:
      equals in class Object
    • hashCode

      public int hashCode()
      Overrides:
      hashCode in class Object