{"record":{"id":"1b16f6f970beb1d2","repo":"OpenFeign/feign","slug":"e-getmessage","errorCode":null,"errorMessage":"${e.getMessage()}","messagePattern":"\\$\\{e\\.getMessage\\(\\)\\}","errorType":"exception","errorClass":"DecodeException","httpStatus":null,"severity":"error","filePath":"core/src/main/java/feign/InvocationContext.java","lineNumber":125,"sourceCode":"    if (!shouldDisconnectResponseBody) {\n      return response;\n    }\n\n    try {\n      final byte[] bodyData = Util.toByteArray(response.body().asInputStream());\n      return response.toBuilder().body(bodyData).build();\n    } finally {\n      ensureClosed(response.body());\n    }\n  }\n\n  private Object decode(Response response, Type returnType) {\n    try {\n      return decoder.decode(response, returnType);\n    } catch (final FeignException e) {\n      throw e;\n    } catch (final RuntimeException e) {\n      throw new DecodeException(response.status(), e.getMessage(), response.request(), e);\n    } catch (IOException e) {\n      throw errorReading(response.request(), response, e);\n    }\n  }\n\n  private Exception decodeError(String methodKey, Response response) {\n    try {\n      return errorDecoder.decode(methodKey, response);\n    } finally {\n      ensureClosed(response.body());\n    }\n  }\n\n  private boolean isVoidType(Type returnType) {\n    return returnType == Void.class\n        || returnType == void.class\n        || returnType.getTypeName().equals(\"kotlin.Unit\");\n  }","sourceCodeStart":107,"sourceCodeEnd":143,"githubUrl":"https://github.com/OpenFeign/feign/blob/e2a1e27560a1e68840c34f031afca88b36096e30/core/src/main/java/feign/InvocationContext.java#L107-L143","documentation":"Thrown as a DecodeException wrapping the original decoder failure when the configured Decoder throws a non-Feign RuntimeException while deserializing the response body into the declared return type. It fires in InvocationContext.decode after the HTTP call succeeded, meaning the response arrived but could not be mapped — commonly a JSON/POJO mismatch (unknown properties, wrong type shape) or a decoder misconfiguration for the method's return Type.","triggerScenarios":"Thrown at core/src/main/java/feign/InvocationContext.java:125 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Verify the interface method's return type matches the actual response body structure (field names, nesting, generics)","Configure the underlying codec (e.g., Jackson ObjectMapper) to match the payload, or use a lenient/fail-safe setting if appropriate","Ensure the correct Decoder is installed for the response content type (e.g., Jackson vs Gson)","Catch DecodeException at the call site to distinguish transport success from deserialization failure"],"exampleFix":null,"handlingStrategy":"try-catch","validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"e2a1e27560a1e68840c34f031afca88b36096e30","analyzedAt":"2026-09-10T12:37:37.238Z","contentChangedAt":"2026-09-10T12:37:37.238Z","schemaVersion":2},"datasetVersion":"2026-09-16T09:17:16.951Z"}