{"record":{"id":"a9f61866a2f861cb","repo":"quarkusio/quarkus","slug":"unsupported-value","errorCode":null,"errorMessage":"Unsupported value: ","messagePattern":"Unsupported value: ","errorType":"exception","errorClass":"IllegalArgumentException","httpStatus":null,"severity":"error","filePath":"extensions/narayana-jta/runtime/src/main/java/io/quarkus/narayana/jta/RunOptions.java","lineNumber":54,"sourceCode":"        if (semantic == null) {\n            setSemantics(null);\n            return this;\n        }\n        switch (semantic) {\n            case DISALLOW_EXISTING:\n                setSemantics(TransactionSemantics.DISALLOW_EXISTING);\n                break;\n            case JOIN_EXISTING:\n                setSemantics(TransactionSemantics.JOIN_EXISTING);\n                break;\n            case REQUIRE_NEW:\n                setSemantics(TransactionSemantics.REQUIRE_NEW);\n                break;\n            case SUSPEND_EXISTING:\n                setSemantics(TransactionSemantics.SUSPEND_EXISTING);\n                break;\n            default:\n                throw new IllegalArgumentException(\"Unsupported value: \" + semantic);\n        }\n        return this;\n    }\n\n    /**\n     * Provides an exception handler that can make a decision to rollback or commit based on the type of exception. If the\n     * predicate returns {@link ExceptionResult#ROLLBACK} the transaction is rolled back,\n     * otherwise it is committed.\n     * <p>\n     * This exception will still be propagated to the caller, so this method should not log or perform any other actions other\n     * than determine what should happen to the current transaction.\n     * <p>\n     * By default, the exception is always rolled back.\n     *\n     * @param handler The exception handler\n     * @return This builder\n     */\n    public RunOptions exceptionHandler(Function<Throwable, ExceptionResult> handler) {","sourceCodeStart":36,"sourceCodeEnd":72,"githubUrl":"https://github.com/quarkusio/quarkus/blob/e1c734241f34c7919086ceb4c9262b4a58f6de44/extensions/narayana-jta/runtime/src/main/java/io/quarkus/narayana/jta/RunOptions.java#L36-L72","documentation":"Thrown when an invalid TransactionSemantics enum value is passed to RunOptions.semantics() on the narayana-jta extension. The switch in the builder only handles REQUIRE_NEW, JOIN_EXISTING and SUSPEND_EXISTING; anything else (e.g. a null or foreign enum) falls into the default branch. It is a programmer-error guard, not a runtime condition.","triggerScenarios":"Calling RunOptions semaphore API: new RunOptions().semantics(<value not one of TransactionSemantics.REQUIRE_NEW / JOIN_EXISTING / SUSPEND_EXISTING>), e.g. a null enum constant or a custom/renamed enum value.","commonSituations":"Refactoring/rename of TransactionSemantics leaving a stale constant; dynamic enum lookup by string (TransactionSemantics.valueOf(userInput)) returning an unexpected constant; copying code between Quarkus versions where enum members changed.","solutions":["Pass exactly one of TransactionSemantics.REQUIRE_NEW, JOIN_EXISTING or SUSPEND_EXISTING","If converting from a string, validate it first via TransactionSemantics.valueOf inside its own try-catch and fall back to a safe default","Check the TransactionSemantics enum in your Quarkus version for the exact set of allowed values"],"exampleFix":"// before\nRunOptions opts = new RunOptions().semantics(TransactionSemantics.valueOf(input));\n// after\nTransactionSemantics s;\ntry { s = TransactionSemantics.valueOf(input); } catch (IllegalArgumentException e) { s = TransactionSemantics.REQUIRE_NEW; }\nRunOptions opts = new RunOptions().semantics(s);","handlingStrategy":"validation","validationCode":"if (semantics != TransactionSemantics.REQUIRE_NEW && semantics != TransactionSemantics.JOIN_EXISTING && semantics != TransactionSemantics.SUSPEND_EXISTING) throw new IllegalArgumentException(\"Unsupported semantics: \" + semantics);","typeGuard":"boolean isValidSemantics(TransactionSemantics s) { return s == TransactionSemantics.REQUIRE_NEW || s == TransactionSemantics.JOIN_EXISTING || s == TransactionSemantics.SUSPEND_EXISTING; }","tryCatchPattern":"try { opts = new RunOptions().semantics(s); } catch (IllegalArgumentException e) { opts = new RunOptions(); /* default semantics */ }","preventionTips":["Only use the enum constants directly, never dynamic valueOf on untrusted strings","Check the enum definition in your Quarkus version before upgrading","Write a unit test covering every RunOptions builder call"],"tags":["narayana-jta","transactions","illegal-argument","enum"],"backgroundTag":"invalid-enum-value","analyzedSha":"e1c734241f34c7919086ceb4c9262b4a58f6de44","analyzedAt":"2026-09-05T17:01:29.979Z","contentChangedAt":"2026-09-05T17:01:29.979Z","schemaVersion":2},"datasetVersion":"2026-09-14T05:17:10.506Z"}