{"record":{"id":"9352da3c70ee9bc3","repo":"quarkusio/quarkus","slug":"unhandled","errorCode":null,"errorMessage":"unhandled","messagePattern":"unhandled","errorType":"http","errorClass":"UnhandledAnnotatedException","httpStatus":null,"severity":"error","filePath":"integration-tests/spring-web/src/main/java/io/quarkus/it/spring/web/ExceptionThrowingController.java","lineNumber":18,"sourceCode":"package io.quarkus.it.spring.web;\n\nimport org.springframework.http.HttpStatus;\nimport org.springframework.http.MediaType;\nimport org.springframework.http.ResponseEntity;\nimport org.springframework.web.bind.annotation.GetMapping;\nimport org.springframework.web.bind.annotation.RequestMapping;\nimport org.springframework.web.bind.annotation.RequestMethod;\nimport org.springframework.web.bind.annotation.RestController;\nimport org.springframework.web.server.ResponseStatusException;\n\n@RestController\n@RequestMapping(\"/exception\")\npublic class ExceptionThrowingController {\n\n    @RequestMapping(method = RequestMethod.GET, path = \"/unhandled/exception\")\n    public void voidWithUnhandledAnnotatedException() throws UnhandledAnnotatedException {\n        throw new UnhandledAnnotatedException(\"unhandled\");\n    }\n\n    @GetMapping(path = \"/unhandled/runtime\")\n    public String stringWithUnhandledAnnotatedRuntimeException() {\n        throw new UnhandledAnnotatedRuntimeException();\n    }\n\n    @GetMapping(\"/runtime\")\n    public void voidWithRuntimeException() {\n        throw new RuntimeException();\n    }\n\n    @GetMapping(\"/unannotated\")\n    public void voidWithUnannotatedException() {\n        throw new HandledUnannotatedException();\n    }\n\n    @GetMapping(\"/re/re\")","sourceCodeStart":1,"sourceCodeEnd":36,"githubUrl":"https://github.com/quarkusio/quarkus/blob/e1c734241f34c7919086ceb4c9262b4a58f6de44/integration-tests/spring-web/src/main/java/io/quarkus/it/spring/web/ExceptionThrowingController.java#L1-L36","documentation":"voidWithUnhandledAnnotatedException throws UnhandledAnnotatedException, a checked exception annotated in a way that deliberately has NO exception mapper registered in this test app. Without a mapper, Quarkus/RESTEasy Reactive maps it to HTTP 500 and propagates the message 'unhandled' — this endpoint exists to test that unmapped-exception behavior.","triggerScenarios":"GET /exception/unhandled/exception — the controller method always throws; there is no success path.","commonSituations":"Integration tests verifying 500 responses for exceptions not covered by an @ServerExceptionMapper or Spring-style @ControllerAdvice; adding a new exception type and forgetting to register a mapper.","solutions":["If intentional (test of unmapped exceptions), expect HTTP 500 and assert on it in tests","Otherwise register an exception mapper: @ServerExceptionMapper for UnhandledAnnotatedException returning an appropriate status","Or make the endpoint not throw / return a meaningful error payload"],"exampleFix":"// before\npublic void voidWithUnhandledAnnotatedException() throws UnhandledAnnotatedException {\n    throw new UnhandledAnnotatedException(\"unhandled\");\n}\n// after\n@ServerExceptionMapper\npublic Response map(UnhandledAnnotatedException e) {\n    return Response.status(500).entity(e.getMessage()).build();\n}","handlingStrategy":"try-catch","validationCode":null,"typeGuard":null,"tryCatchPattern":"Response resp = given().get(\"/exception/unhandled/exception\");\nif (resp.statusCode() == 500) {\n    // expected: UnhandledAnnotatedException has no registered mapper\n}","preventionTips":["Register @ServerExceptionMapper (or Spring @ExceptionHandler) for every custom exception type","Keep an inventory of exception classes and their mapped HTTP statuses","Add tests asserting status codes for every throwing endpoint"],"tags":["spring-web","resteasy-reactive","exception-mapping","http-500"],"backgroundTag":"unhandled-exception-mapper","analyzedSha":"e1c734241f34c7919086ceb4c9262b4a58f6de44","analyzedAt":"2026-09-05T17:01:29.979Z","contentChangedAt":"2026-09-05T17:01:29.979Z","schemaVersion":2},"datasetVersion":"2026-09-12T22:17:10.623Z"}