{"record":{"id":"b3696a576f0c913b","repo":"quarkusio/quarkus","slug":"can-only-greet-nicknames","errorCode":null,"errorMessage":"Can only greet nicknames","messagePattern":"Can only greet nicknames","errorType":"exception","errorClass":"IllegalArgumentException","httpStatus":null,"severity":"info","filePath":"integration-tests/amazon-lambda/src/main/java/io/quarkus/it/amazon/lambda/ProcessingService.java","lineNumber":12,"sourceCode":"package io.quarkus.it.amazon.lambda;\n\nimport jakarta.enterprise.context.ApplicationScoped;\n\n@ApplicationScoped\npublic class ProcessingService {\n\n    public static final String CAN_ONLY_GREET_NICKNAMES = \"Can only greet nicknames\";\n\n    public OutputObject process(InputObject input) {\n        if (input.getName().equals(\"Stuart\")) {\n            throw new IllegalArgumentException(CAN_ONLY_GREET_NICKNAMES);\n        }\n        String result = input.getGreeting() + \" \" + input.getName();\n        OutputObject out = new OutputObject();\n        out.setResult(result);\n        return out;\n    }\n}\n","sourceCodeStart":1,"sourceCodeEnd":20,"githubUrl":"https://github.com/quarkusio/quarkus/blob/e1c734241f34c7919086ceb4c9262b4a58f6de44/integration-tests/amazon-lambda/src/main/java/io/quarkus/it/amazon/lambda/ProcessingService.java#L1-L20","documentation":"ProcessingService.process() is a Lambda handler used by the amazon-lambda integration test to exercise error propagation: it throws IllegalArgumentException(CAN_ONLY_GREET_NICKNAMES) when the input's name is exactly \"Stuart\". Any other name produces greeting + name. This is a deliberate sentinel error proving exceptions in Lambda handlers surface as invocation errors.","triggerScenarios":"Invoking the Lambda (directly or via API/HTTP test clients) with an InputObject whose name field equals \"Stuart\"; the handler immediately throws before building the OutputObject.","commonSituations":"Running the amazon-lambda integration tests; manually testing Lambda error responses with sample events that use name \"Stuart\"; copying the sample test event JSON that intentionally triggers the failure.","solutions":["Use an InputObject with a name other than \"Stuart\" (e.g. \"Alice\") to get a successful result","If testing errors, keep \"Stuart\" and assert on the IllegalArgumentException / Lambda error response","If this appears unexpectedly, check the request payload's name field for the sentinel value"],"exampleFix":"// before\n{\"name\":\"Stuart\"}   // throws IllegalArgumentException\n// after\n{\"name\":\"Alice\"}    // returns {\"result\":\"Hello Alice\"} (per configured greeting)","handlingStrategy":"validation","validationCode":"if (\"Stuart\".equals(input.getName())) {\n    // this invocation will throw IllegalArgumentException by design\n}","typeGuard":null,"tryCatchPattern":"try {\n    OutputObject out = service.process(input);\n} catch (IllegalArgumentException e) {\n    if (ProcessingService.CAN_ONLY_GREET_NICKNAMES.equals(e.getMessage())) {\n        // known sentinel error, handle gracefully\n    } else {\n        throw e;\n    }\n}","preventionTips":["Avoid the sentinel name \"Stuart\" in production payloads","Validate name input before invoking the handler","When testing errors intentionally, assert on CAN_ONLY_GREET_NICKNAMES message"],"tags":["aws-lambda","test","intentional-failure","input-validation"],"backgroundTag":"intentional-test-exception","analyzedSha":"e1c734241f34c7919086ceb4c9262b4a58f6de44","analyzedAt":"2026-09-05T17:01:29.979Z","contentChangedAt":"2026-09-05T17:01:29.979Z","schemaVersion":2},"datasetVersion":"2026-09-14T00:17:10.932Z"}