{"record":{"id":"883b13c74e179ed7","repo":"pinpoint-apm/pinpoint","slug":"runtimeexception-wrapping-ioexception-from-getstat","errorCode":null,"errorMessage":"RuntimeException wrapping IOException from getStatusCode","messagePattern":"RuntimeException wrapping IOException from getStatusCode","errorType":"exception","errorClass":"RuntimeException","httpStatus":null,"severity":"error","filePath":"agent-module/plugins/resttemplate/src/main/java/com/navercorp/pinpoint/plugin/resttemplate/interceptor/util/Spring6HttpStatusProvider.java","lineNumber":33,"sourceCode":" */\npackage com.navercorp.pinpoint.plugin.resttemplate.interceptor.util;\n\nimport org.springframework.http.client.ClientHttpResponse;\n\nimport java.io.IOException;\n\n/**\n * @author intr3p1d\n */\npublic class Spring6HttpStatusProvider implements HttpStatusProvider {\n    @Override\n    public int getStatusCode(Object target) {\n        if (target instanceof ClientHttpResponse) {\n            final ClientHttpResponse response = (ClientHttpResponse) target;\n            try {\n                return response.getStatusCode().value();\n            } catch (IOException e) {\n                throw new RuntimeException(e);\n            }\n        }\n        return -1;\n    }\n}\n","sourceCodeStart":15,"sourceCodeEnd":39,"githubUrl":"https://github.com/pinpoint-apm/pinpoint/blob/744c3d3075e595656abb1ae331ad2c0e4c9eb996/agent-module/plugins/resttemplate/src/main/java/com/navercorp/pinpoint/plugin/resttemplate/interceptor/util/Spring6HttpStatusProvider.java#L15-L39","documentation":"Guard in Spring6HttpStatusProvider.getStatusCode: calling ClientHttpResponse.getStatusCode() on the instrumented response threw IOException (stream/connection failure while reading status); the provider wraps it in a RuntimeException so the interceptor can surface the failure.","triggerScenarios":"Thrown at agent-module/plugins/resttemplate/src/main/java/com/navercorp/pinpoint/plugin/resttemplate/interceptor/util/Spring6HttpStatusProvider.java:33 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Inspect the wrapped IOException cause for the underlying connection/stream problem","Ensure the HTTP response stream is still open when the status code is read in the RestTemplate interceptor","Upgrade the resttemplate plugin if the wrap behavior is too aggressive for your Spring 6 version"],"exampleFix":null,"handlingStrategy":"try-catch","validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"744c3d3075e595656abb1ae331ad2c0e4c9eb996","analyzedAt":"2026-09-07T18:48:45.289Z","contentChangedAt":"2026-09-07T18:48:45.289Z","schemaVersion":2},"datasetVersion":"2026-09-17T15:17:12.973Z"}