[
https://issues.apache.org/jira/browse/TINKERPOP3-945?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=15022343#comment-15022343
]
ASF GitHub Bot commented on TINKERPOP3-945:
-------------------------------------------
Github user spmallette commented on the pull request:
https://github.com/apache/incubator-tinkerpop/pull/149#issuecomment-158979326
it's nice that you have "root cause" as optional to avoid breaking change.
in that way, it is optional for providers to pass a cause and if they just want
a vanilla exception they can use it that way. I guess that opens up the
opportunity for there to be some inconsistency in the exceptions as one
provider might choose to include cause and the other might not have a cause in
the first place to throw....that might not matter i suppose.
I also wonder if all exceptions should have this option. It's a bigger
change, but perhaps all exception methods should be deprecated and instead
return some sort of `ExceptionBuilder<T extends Throwable>`. That way, the
provider could do something like:
```text
throw
Property.Exceptions.buildDataTypeOfPropertyValueNotSupported(value).cause(root).create();
```
or
```text
throw
Property.Exceptions.buildDataTypeOfPropertyValueNotSupported(value).create();
```
as the need was required. Then this would be consistently applied. Of
course, perhaps this specific issue is isolated as a problem and we aren't
hiding "native" causes and messages elsewhere. If that's the case, then this
pull request is the "simple" thing to do.
> Exceptions should allow me to include root cause if/when available
> ------------------------------------------------------------------
>
> Key: TINKERPOP3-945
> URL: https://issues.apache.org/jira/browse/TINKERPOP3-945
> Project: TinkerPop 3
> Issue Type: Improvement
> Components: structure
> Affects Versions: 3.0.2-incubating
> Reporter: Marvin Froeder
> Priority: Minor
>
> As it is, right now, I'm forced to break the exception chain while throwing
> standard exceptions
> https://github.com/apache/incubator-tinkerpop/commit/34ec9e7f60f15b5dbfa684a8e96668d9bbcb6752#commitcomment-14240563
--
This message was sent by Atlassian JIRA
(v6.3.4#6332)