{"record":{"id":"e5694e45e94b36ef","repo":"flowable/flowable-engine","slug":"unhandled-exception-on-camel-route","errorCode":null,"errorMessage":"Unhandled exception on camel route","messagePattern":"Unhandled exception on camel route","errorType":"exception","errorClass":"FlowableException","httpStatus":null,"severity":"error","filePath":"modules/flowable-camel/src/main/java/org/flowable/camel/CamelBehavior.java","lineNumber":189,"sourceCode":"    protected boolean handleCamelException(Exchange exchange, DelegateExecution execution, boolean isV5Execution) {\n        Exception camelException = exchange.getException();\n        boolean notHandledByCamel = exchange.isFailed() && camelException != null;\n        if (notHandledByCamel) {\n            if (camelException instanceof BusinessError) {\n                if (isV5Execution) {\n                    Flowable5CompatibilityHandler compatibilityHandler = Flowable5Util.getFlowable5CompatibilityHandler();\n                    compatibilityHandler.propagateError((BpmnError) camelException, execution);\n                    return true;\n                }\n                ErrorPropagation.propagateError((BusinessError) camelException, execution);\n                return true;\n            } else {\n                if (isV5Execution) {\n                    Flowable5CompatibilityHandler ompatibilityHandler = Flowable5Util.getFlowable5CompatibilityHandler();\n                    if (ompatibilityHandler.mapException(camelException, execution, mapExceptions)) {\n                        return true;\n                    } else {\n                        throw new FlowableException(\"Unhandled exception on camel route\", camelException);\n                    }\n                }\n\n                if (ErrorPropagation.mapException(camelException, (ExecutionEntity) execution, mapExceptions)) {\n                    return true;\n                } else {\n                    throw new FlowableException(\"Unhandled exception on camel route\", camelException);\n                }\n            }\n        }\n        return false;\n    }\n\n    protected void copyVariablesToProperties(Map<String, Object> variables, Exchange exchange) {\n        for (Map.Entry<String, Object> var : variables.entrySet()) {\n            exchange.setProperty(var.getKey(), var.getValue());\n        }\n    }","sourceCodeStart":171,"sourceCodeEnd":207,"githubUrl":"https://github.com/flowable/flowable-engine/blob/d6d39ce1c69ff244f2d9dc6af756a9b95e865586/modules/flowable-camel/src/main/java/org/flowable/camel/CamelBehavior.java#L171-L207","documentation":"After a Camel exchange completes with an exception, handleCamelException tries to map it to BPMN error handling via mapException (Flowable5 path first). If the exception matches no mapException entry and no error handling applies, FlowableException 'Unhandled exception on camel route' is thrown with the Camel exception as cause (V5 path).","triggerScenarios":"Camel route throws an exception during execution of a V5-compatible activity; no mapException entries match the exception class; no errorBoundaryEvent/handler exists on the activity.","commonSituations":"Business exceptions thrown in Camel beans without error handling in the BPMN model; upgrading/maintaining Flowable5 compatibility routes.","solutions":["Add a mapException entry on the activity matching the exception class","Attach a boundary error event to the service task to catch the error","Fix the Camel route so it doesn't throw (or handle the exception inside the route with onException/doTry)","Inspect getCause() to identify the original Camel exception"],"exampleFix":"<!-- after: map the camel exception -->\n<serviceTask id=\"camelTask\" flowable:type=\"camel\">\n  <flowable:mapException errorCode=\"CAMEL_ERR\" exceptionClass=\"com.acme.MyBusinessException\" andChildren=\"true\"/>\n</serviceTask>","handlingStrategy":"fallback","validationCode":null,"typeGuard":null,"tryCatchPattern":"catch (FlowableException e) { if (e.getMessage().contains(\"Unhandled exception on camel route\")) { /* fallback handling using e.getCause() */ } }","preventionTips":["Provide mapException fallback entries and boundary error events for camel tasks"],"tags":["camel","integration","exception-mapping"],"backgroundTag":"unhandled-exception-mapping","analyzedSha":"d6d39ce1c69ff244f2d9dc6af756a9b95e865586","analyzedAt":"2026-09-11T06:41:19.413Z","contentChangedAt":"2026-09-11T06:41:19.413Z","schemaVersion":2},"datasetVersion":"2026-09-14T11:17:12.474Z"}