-
-
Notifications
You must be signed in to change notification settings - Fork 765
Description
Summary
When some Throwable-related assertion fails the actual Throwable that failed the check is not described beyond what actually caused assertion failure (e.g. message mismatch). In non-trivial code when unexpected Exceptions are thrown this makes debugging inconvenient.
Dumping more comprehensive (class, message, stack, perhaps even recursive info about causes) info about the actual Throwable could ease assertion failure investigation.
Relevant message factories (e.g. ShouldHaveMessage) already have access to actual Throwable.
It may be tempting to use util.Throwables.ERROR_DESCRIPTION_EXTRACTOR to describe throwables, but a more powerful mechanism would be appreciated.
Providing precise information in case of assertion failure doesn't seem to be overkill (unlike as in #864)
Error message to improve
- ShouldHaveCause Added Throwable Stacktrace to ShouldHaveCause #2872
- ShouldHaveCauseExactlyInstance
- ShouldHaveCauseInstance
- ShouldHaveCauseReference - @weiyilei
- ShouldHaveNoCause
- ShouldHaveNoSuppressedExceptions
- ShouldHaveRootCauseExactlyInstance Added Throwable Stacktrace to ShouldHaveRootCauseInstance and ShouldH… #2910
- ShouldHaveRootCauseInstance Added Throwable Stacktrace to ShouldHaveRootCauseInstance and ShouldH… #2910
- ShouldHaveSuppressedException
- ShouldNotContainCharSequence
- ShouldStartWith
- ShouldEndWith
If you are interested in contributing to this issue, select one error message, it will be assigned to you.