{"record":{"id":"e48da29d8e77caa5","repo":"aeron-io/aeron","slug":"einval-e48da2","errorCode":"EINVAL","errorMessage":"unknown action","messagePattern":"unknown action","errorType":"exception","errorClass":"IllegalArgumentException","httpStatus":null,"severity":"error","filePath":"aeron-client/src/main/cpp_wrapper/ImageControlledFragmentAssembler.h","lineNumber":107,"sourceCode":"        ControlledPollAction action = assembler->m_delegate(bufferWrapper, 0, (util::index_t)length, headerWrapper);\n\n        switch (action)\n        {\n            case ControlledPollAction::ABORT:\n                return AERON_ACTION_ABORT;\n                break;\n            case ControlledPollAction::BREAK:\n                return AERON_ACTION_BREAK;\n                break;\n            case ControlledPollAction::COMMIT:\n                return AERON_ACTION_COMMIT;\n                break;\n            case ControlledPollAction::CONTINUE:\n                return AERON_ACTION_CONTINUE;\n                break;\n        }\n\n        throw IllegalArgumentException(\"unknown action\", SOURCEINFO, EINVAL);\n    }\n\n    ControlledPollAction onFragment(AtomicBuffer &buffer, util::index_t offset, util::index_t length, Header &header)\n    {\n        aeron_controlled_fragment_handler_action_t action = aeron_image_controlled_fragment_assembler_handler(\n            m_fragment_assembler,\n            buffer.buffer() + offset,\n            length,\n            header.hdr());\n\n        switch (action)\n        {\n            case AERON_ACTION_ABORT:\n                return ControlledPollAction::ABORT;\n                break;\n            case AERON_ACTION_BREAK:\n                return ControlledPollAction::BREAK;\n                break;","sourceCodeStart":89,"sourceCodeEnd":125,"githubUrl":"https://github.com/aeron-io/aeron/blob/6d60124e15e35c11b49ba2e3c2c2858a09a18803/aeron-client/src/main/cpp_wrapper/ImageControlledFragmentAssembler.h#L89-L125","documentation":"Thrown by ImageControlledFragmentAssembler::handlerCallback when the ControlledPollAction returned by the user's image controlled fragment handler does not correspond to any value handled in the mapping switch. As with the non-Image assembler, an unrecognized action is an internal invariant violation. The wrapper cannot convert the action to the C AERON_ACTION_* constant.","triggerScenarios":"An image-controlled fragment handler returning an out-of-range ControlledPollAction (uninitialized variable, cast integer, or an enumerator unknown to the compiled wrapper switch).","commonSituations":"Custom per-Image handlers with a missing return path, uninitialized action variables, or handler code compiled against different Aeron headers than the linked library.","solutions":["Ensure every code path of your handler returns a defined ControlledPollAction (ABORT, COMMIT, BREAK, CONTINUE).","Never cast arbitrary integers to ControlledPollAction; always use the enum constants.","Initialize any action variable and add a default return for all branches.","Rebuild handler and library with the same Aeron version so enum definitions match."],"exampleFix":"// before\nControlledPollAction action;\nif (x) action = ControlledPollAction::COMMIT;\nreturn action;\n// after\nif (x) return ControlledPollAction::COMMIT;\nreturn ControlledPollAction::CONTINUE;","handlingStrategy":"validation","validationCode":"ControlledPollAction sanitize(ControlledPollAction a) {\n  switch (a) {\n    case ControlledPollAction::ABORT:\n    case ControlledPollAction::COMMIT:\n    case ControlledPollAction::BREAK:\n    case ControlledPollAction::CONTINUE:\n      return a;\n    default:\n      return ControlledPollAction::CONTINUE;\n  }\n}","typeGuard":"bool isDefinedAction(ControlledPollAction a) {\n  switch (a) {\n    case ControlledPollAction::ABORT:\n    case ControlledPollAction::COMMIT:\n    case ControlledPollAction::BREAK:\n    case ControlledPollAction::CONTINUE:\n      return true;\n    default:\n      return false;\n  }\n}","tryCatchPattern":"try { image.controlledPoll(handler); }\ncatch (const aeron::util::IllegalArgumentException& e) {\n  if (std::string(e.what()) == \"unknown action\") {\n    log(\"image handler returned undefined action\");\n  }\n}","preventionTips":["Every handler return path must yield a defined ControlledPollAction","Use enum constants, never integer casts","Initialize action variables","Keep handler and library compiled from one Aeron version"],"tags":["aeron","cpp","image","fragment-handler","einval"],"backgroundTag":"invalid-enum-value","analyzedSha":"6d60124e15e35c11b49ba2e3c2c2858a09a18803","analyzedAt":"2026-09-12T11:17:07.683Z","contentChangedAt":"2026-09-12T11:17:07.683Z","schemaVersion":2},"datasetVersion":"2026-09-15T23:17:13.987Z"}