Title: DocumentException didn't initalize cause in the standard way and lose inner stack trace when using logback · Issue #20 · dom4j/dom4j · GitHub
Open Graph Title: DocumentException didn't initalize cause in the standard way and lose inner stack trace when using logback · Issue #20 · dom4j/dom4j
X Title: DocumentException didn't initalize cause in the standard way and lose inner stack trace when using logback · Issue #20 · dom4j/dom4j
Description: In the class org.dom4j.DocumentException public DocumentException(Throwable nestedException) { super(nestedException.getMessage()); this.nestedException = nestedException; } public DocumentException(String message, Throwable nestedExcept...
Open Graph Description: In the class org.dom4j.DocumentException public DocumentException(Throwable nestedException) { super(nestedException.getMessage()); this.nestedException = nestedException; } public DocumentExceptio...
X Description: In the class org.dom4j.DocumentException public DocumentException(Throwable nestedException) { super(nestedException.getMessage()); this.nestedException = nestedException; } public DocumentExceptio...
Opengraph URL: https://github.com/dom4j/dom4j/issues/20
X: @github
Domain: github-redirect.dependabot.com
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"DocumentException didn't initalize cause in the standard way and lose inner stack trace when using logback","articleBody":"In the class org.dom4j.DocumentException\r\n```\r\npublic DocumentException(Throwable nestedException) {\r\n\tsuper(nestedException.getMessage());\r\n\tthis.nestedException = nestedException;\r\n}\r\n\r\npublic DocumentException(String message, Throwable nestedException) {\r\n\tsuper(message);\r\n\tthis.nestedException = nestedException;\r\n}\r\n```\r\nThese two constructor function didn't assign inner exception to java.lang.Throwable.cause.\r\nInstead,it used org.dom4j.DocumentException.nestedException.\r\nWhen I used Logback to log the error,the inner exception stack is lost.\r\n\r\nCurrently, i used the following code to get around it.\r\n\r\n```\r\npublic static void fillDom4jCause(Throwable t) {\r\n\tif (null == t) {\r\n\t\treturn;\r\n\t}\r\n\tif (t instanceof org.dom4j.DocumentException) {\r\n\t\tThrowable inner = ((org.dom4j.DocumentException) t).getNestedException();\r\n\t\tif (null == inner)\r\n\t\t\treturn;\r\n\t\tfillDom4jCause(inner);\r\n\t\tt.initCause(inner);\r\n\t}\r\n\telse {\r\n\t\tThrowable inner = t.getCause();\r\n\t\tif (null == inner)\r\n\t\t\treturn;\r\n\t\tfillDom4jCause(inner);\r\n\t}\r\n}\r\n```\r\n\r\n","author":{"url":"https://github.com/tankilo","@type":"Person","name":"tankilo"},"datePublished":"2016-12-28T05:18:18.000Z","interactionStatistic":{"@type":"InteractionCounter","interactionType":"https://schema.org/CommentAction","userInteractionCount":0},"url":"https://github.com/20/dom4j/issues/20"}
| 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:a981ddde-116b-9d2a-13cf-a9254ee462a2 |
| current-catalog-service-hash | 81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114 |
| request-id | AF5E:2ACFE8:1817545:1FE54C1:6996B5EE |
| html-safe-nonce | 1614b3179eaed1af8feeaa3780d52000945538bbb7adb898c2460c44c30e3442 |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJBRjVFOjJBQ0ZFODoxODE3NTQ1OjFGRTU0QzE6Njk5NkI1RUUiLCJ2aXNpdG9yX2lkIjoiMjc4NTU5NDU1NTkxNTIyMDQ2MiIsInJlZ2lvbl9lZGdlIjoiaWFkIiwicmVnaW9uX3JlbmRlciI6ImlhZCJ9 |
| visitor-hmac | 0de87b6d7497d6be6d693c4cb07d50f37c89463699e545ac0647e92067e9f246 |
| hovercard-subject-tag | issue:197797501 |
| 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/dom4j/dom4j/20/issue_layout |
| twitter:image | https://opengraph.githubassets.com/250c17d526729dcba3400bf6264a7b3767e2460ba44bd39f610bf13743fcced7/dom4j/dom4j/issues/20 |
| twitter:card | summary_large_image |
| og:image | https://opengraph.githubassets.com/250c17d526729dcba3400bf6264a7b3767e2460ba44bd39f610bf13743fcced7/dom4j/dom4j/issues/20 |
| og:image:alt | In the class org.dom4j.DocumentException public DocumentException(Throwable nestedException) { super(nestedException.getMessage()); this.nestedException = nestedException; } public DocumentExceptio... |
| og:image:width | 1200 |
| og:image:height | 600 |
| og:site_name | GitHub |
| og:type | object |
| og:author:username | tankilo |
| hostname | github.com |
| expected-hostname | github.com |
| None | 5513290f8d09a9ed78de519ab8316ed23b2b0ddd5e91d2420df56691d00827e8 |
| turbo-cache-control | no-preview |
| go-import | github.com/dom4j/dom4j git https://github.com/dom4j/dom4j.git |
| octolytics-dimension-user_id | 13147578 |
| octolytics-dimension-user_login | dom4j |
| octolytics-dimension-repository_id | 38423426 |
| octolytics-dimension-repository_nwo | dom4j/dom4j |
| octolytics-dimension-repository_public | true |
| octolytics-dimension-repository_is_fork | false |
| octolytics-dimension-repository_network_root_id | 38423426 |
| octolytics-dimension-repository_network_root_nwo | dom4j/dom4j |
| 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 | f514dad261e3ac9cceca6fa432a562be2927d949 |
| ui-target | full |
| theme-color | #1e2327 |
| color-scheme | light dark |
Links:
Viewport: width=device-width