{"record":{"id":"17feab6646e9919f","repo":"flowable/flowable-engine","slug":"e-getmessage-17feab","errorCode":null,"errorMessage":"${e.getMessage()}","messagePattern":"\\$\\{e\\.getMessage\\(\\)\\}","errorType":"exception","errorClass":"FlowableException","httpStatus":500,"severity":"error","filePath":"modules/flowable-event-registry-rest/src/main/java/org/flowable/eventregistry/rest/service/api/repository/DeploymentCollectionResource.java","lineNumber":235,"sourceCode":"            }\n\n            if (tenantId != null) {\n                deploymentBuilder.tenantId(tenantId);\n            }\n\n            if (restApiInterceptor != null) {\n                restApiInterceptor.enhanceDeployment(deploymentBuilder);\n            }\n\n            EventDeployment deployment = deploymentBuilder.deploy();\n\n            return restResponseFactory.createDeploymentResponse(deployment);\n\n        } catch (Exception e) {\n            if (e instanceof FlowableException) {\n                throw (FlowableException) e;\n            }\n            throw new FlowableException(e.getMessage(), e);\n        }\n    }\n\n    public Map<String, String> splitQueryString(String queryString) {\n        if (StringUtils.isEmpty(queryString)) {\n            return Collections.emptyMap();\n        }\n        Map<String, String> queryMap = new HashMap<>();\n        for (String param : queryString.split(\"&\")) {\n            queryMap.put(StringUtils.substringBefore(param, \"=\"), decode(StringUtils.substringAfter(param, \"=\")));\n        }\n        return queryMap;\n    }\n\n    protected String decode(String string) {\n        if (string != null) {\n            return URLDecoder.decode(string, StandardCharsets.UTF_8);\n        }","sourceCodeStart":217,"sourceCodeEnd":253,"githubUrl":"https://github.com/flowable/flowable-engine/blob/d6d39ce1c69ff244f2d9dc6af756a9b95e865586/modules/flowable-event-registry-rest/src/main/java/org/flowable/eventregistry/rest/service/api/repository/DeploymentCollectionResource.java#L217-L253","documentation":"uploadDeployment wraps the whole deployment operation in a try/catch: FlowableException subclasses are rethrown as-is, but any other Exception (IO errors, NPEs, runtime failures) is converted into a generic FlowableException whose message is the underlying exception's message. The reported message is therefore whatever the cause produced.","triggerScenarios":"Any unexpected exception during uploadDeployment: reading the uploaded InputStream fails, the underlying deployment service throws a non-Flowable exception, or query-string parsing hits an unexpected error.","commonSituations":"Corrupted upload streams, missing deployment parameters causing NPEs, database/IO failures during deployment persistence, catching a wrapped exception in tests without inspecting the cause.","solutions":["Read the 'cause' of the thrown FlowableException to find the real root error.","Enable debug logging around the deployment call to capture the original stack trace.","Fix the underlying cause (IO, DB, or null parameter) surfaced by the wrapped message.","Wrap your client call in try/catch for FlowableException and log getCause()."],"exampleFix":"// before\nthrow new RuntimeException(e.getMessage());\n// after (library behavior): inspect cause\ncatch (FlowableException e) {\n    logger.error(\"deployment failed: {}\", e.getCause(), e);\n}","handlingStrategy":"try-catch","validationCode":"null","typeGuard":"null","tryCatchPattern":"try {\n    uploadDeployment(file, params);\n} catch (FlowableException e) {\n    Throwable cause = e.getCause();\n    logger.error(\"Deployment failed: {} (cause: {})\", e.getMessage(), cause, e);\n}","preventionTips":["Always inspect getCause() on wrapped deployment errors","Log the full stack trace, not just the message","Test deployments with all parameters set to avoid NPE paths"],"tags":["rest","wrapping","event-registry"],"backgroundTag":"api-error-response","analyzedSha":"d6d39ce1c69ff244f2d9dc6af756a9b95e865586","analyzedAt":"2026-09-11T06:41:19.413Z","contentChangedAt":"2026-09-11T06:41:19.413Z","schemaVersion":2},"datasetVersion":"2026-09-18T11:17:12.947Z"}