Title: Only the innermost exception is returned when activity functions throw · Issue #238 · microsoft/durabletask-java · GitHub
Open Graph Title: Only the innermost exception is returned when activity functions throw · Issue #238 · microsoft/durabletask-java
X Title: Only the innermost exception is returned when activity functions throw · Issue #238 · microsoft/durabletask-java
Description: When an activity function throws an exception, we return a FailureDetails but it only represents the innermost exception. Request changing this behavior to match the other durable language implementations returning the outermost user err...
Open Graph Description: When an activity function throws an exception, we return a FailureDetails but it only represents the innermost exception. Request changing this behavior to match the other durable language implemen...
X Description: When an activity function throws an exception, we return a FailureDetails but it only represents the innermost exception. Request changing this behavior to match the other durable language implemen...
Opengraph URL: https://github.com/microsoft/durabletask-java/issues/238
X: @github
Domain: github.com
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"Only the innermost exception is returned when activity functions throw","articleBody":"When an activity function throws an exception, we return a FailureDetails but it only represents the innermost exception. Request changing this behavior to match the other durable language implementations returning the outermost user error and all inner errors recursively. \n\nRepro code: \n```java\n @FunctionName(\"CustomRetryActivityFunction\")\n public String customRetryActivityFunction(\n @DurableOrchestrationTrigger(name = \"ctx\") TaskOrchestrationContext ctx) {\n TaskOptions options = new TaskOptions(retryContext -> {\n FailureDetails lastFailure = retryContext.getLastFailure();\n if (lastFailure != null\n // BUG: Only the innermost failure is available in the Java SDK\n // BUG: isCausedBy() relies on Class.forName() but we do not provide the fully qualified class name\n // in the FailureDetails \n && lastFailure.getErrorType().equals(\"OverflowException\")\n // && lastFailure.isCausedBy(InvalidOperationException.class)\n // BUG: We do not implement inner failures in the Java SDK yet\n // && lastFailure.getInnerFailure() != null\n // && lastFailure.getInnerFailure().isCausedBy(\"java.lang.OverflowException\")\n && retryContext.getLastAttemptNumber() \u003c 3) {\n return true;\n }\n return false;\n });\n return ctx.callActivity(\"RaiseComplexException\", ctx.getInstanceId(), options, String.class).await();\n }\n\n @FunctionName(\"RaiseComplexException\")\n public String raiseComplexException(\n @DurableActivityTrigger(name = \"instanceId\") String instanceId,\n final ExecutionContext context) throws InvalidOperationException {\n AtomicInteger count = globalRetryCount.computeIfAbsent(instanceId, k -> new AtomicInteger(0));\n int current = count.incrementAndGet();\n if (current == 1) {\n OverflowException inner = new OverflowException(\"Inner exception message\");\n InvalidOperationException ex = new InvalidOperationException(\n \"This activity failed\\r\\nMore information about the failure\", inner);\n throw ex;\n } else {\n return \"Success\";\n }\n }\n```\n\nResult: \n\n\u003cimg width=\"784\" height=\"208\" alt=\"Image\" src=\"https://github.com/user-attachments/assets/d2e98fe9-65b4-4cc2-bed0-e0277ac4d45f\" />","author":{"url":"https://github.com/andystaples","@type":"Person","name":"andystaples"},"datePublished":"2025-08-27T16:58:36Z","url":"https://github.com/microsoft/durabletask-java/issues/238"}
| react-profiling | 0 |
| react-import-map | react,react-dom,react-dom/client,react-dom/profiling,react-is,react/compiler-runtime,react/jsx-dev-runtime,react/jsx-runtime,scheduler@b8488ee2c322 |
| route-pattern | /_view_fragments/issues/show/:user_id/:repository/:id/issue_layout(.:format) |
| route-controller | voltron_issues_fragments |
| route-action | issue_layout |
| fetch-nonce | v2:7ec936d8-f47f-3e44-2741-b1c6a1d5fa97 |
| current-catalog-service-hash | 81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114 |
| request-id | 8052:144CBF:7E116:A5838:6AFE31CE |
| html-safe-nonce | 38b9eb5500a2a5a567739029009f7bc27381ca391112b560f20282f29d23b33b |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiI4MDUyOjE0NENCRjo3RTExNjpBNTgzODo2QUZFMzFDRSIsInZpc2l0b3JfaWQiOiI4OTEzNzAzOTQ3NDIwNDQ3MTgyIiwicmVnaW9uX2VkZ2UiOiJpYWQiLCJyZWdpb25fcmVuZGVyIjoiaWFkIn0= |
| visitor-hmac | e4d0b274b1735853a4c59eb38c19bc5181c1fa6b0554b87ceee944e8989722a9 |
| hovercard-subject-tag | issue:3360136567 |
| github-keyboard-shortcuts | repository,issues,copilot |
| google-site-verification | Apib7-x98H0j5cPqHWwSMm6dNU4GmODRoqxLiDzdx9I |
| octolytics-url | https://collector.github.com/github/collect |
| analytics-location | / |
| fb:app_id | 1401488693436528 |
| apple-itunes-app | app-id=1477376905, app-argument=https://github.com/_view_fragments/issues/show/microsoft/durabletask-java/238/issue_layout |
| twitter:image | https://opengraph.githubassets.com/99f22d2ae4862aa42af3a1e7392cdb76996991acf8f99779dfb8c65dacb2fd4c/microsoft/durabletask-java/issues/238 |
| twitter:card | summary_large_image |
| og:image | https://opengraph.githubassets.com/99f22d2ae4862aa42af3a1e7392cdb76996991acf8f99779dfb8c65dacb2fd4c/microsoft/durabletask-java/issues/238 |
| og:image:alt | When an activity function throws an exception, we return a FailureDetails but it only represents the innermost exception. Request changing this behavior to match the other durable language implemen... |
| og:image:width | 1200 |
| og:image:height | 600 |
| og:site_name | GitHub |
| og:type | object |
| og:author:username | andystaples |
| hostname | github.com |
| expected-hostname | github.com |
| None | d70e31220a67f6376c108d2416fa8e7df854c1065b1672ab7a88ab6dc3a809e2 |
| turbo-cache-control | no-preview |
| go-import | github.com/microsoft/durabletask-java git https://github.com/microsoft/durabletask-java.git |
| octolytics-dimension-user_id | 6154722 |
| octolytics-dimension-user_login | microsoft |
| octolytics-dimension-repository_id | 452823832 |
| octolytics-dimension-repository_nwo | microsoft/durabletask-java |
| octolytics-dimension-repository_public | true |
| octolytics-dimension-repository_is_fork | false |
| octolytics-dimension-repository_network_root_id | 452823832 |
| octolytics-dimension-repository_network_root_nwo | microsoft/durabletask-java |
| turbo-body-classes | logged-out env-production page-responsive |
| disable-turbo | false |
| browser-stats-url | https://api.github.com/_private/browser/stats |
| browser-errors-url | https://api.github.com/_private/browser/errors |
| release | ccb88d9c92abe69245b429398c8a57ae87070c7c |
| ui-target | full |
| theme-color | #1e2327 |
| color-scheme | light dark |
| react-app-name | issues |
Links:
Viewport: width=device-width