code: private boolean isJsonProcessingException(Exception e) {
          // Unfortunately Jackson doesn't have specific subclasses for each parse exception, so we have to use the
          // more brittle approach of checking the exception message.
          return e instanceof JsonProcessingException &&
                  !(e instanceof JsonParseException &&
                      e.getMessage() != null &&
                      e.getMessage().startsWith("Unexpected end-of-input"));
      }
docs: Returns true if the exception is a JsonProcessingException whose root cause is not a premature end of data,
  since this is more likely caused by a connection error.