static IllegalArgumentException exceptionReading(String type, Exception e) {
    String cause = e.getMessage() == null ? "Error" : e.getMessage();
    if (cause.contains("Expected BEGIN_OBJECT")
      || cause.contains("Expected BEGIN_ARRAY")
      || cause.contains("malformed")) {
      cause = "Malformed";
    }
    String message = format("%s reading %s from json", cause, type);
    throw new IllegalArgumentException(message, e);
  }
Inability to encode is a programming bug.
zipkin/src/main/java/zipkin2/internal/JsonCodec.java