Skip to content

Commit

Permalink
ISSUE-639: Attach original exception as a suppressed one
Browse files Browse the repository at this point in the history
  • Loading branch information
Nikitae57 committed Aug 16, 2024
1 parent c9edb88 commit af15496
Showing 1 changed file with 6 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,7 @@ class FailureLoggingProviderImpl(
* @return transformed [error].
*/
private fun Throwable.describedWith(viewMatcher: Matcher<View>?): Throwable {
return when {
val newError = when {
this is PerformException -> {
PerformException.Builder()
.from(this)
Expand All @@ -93,7 +93,11 @@ class FailureLoggingProviderImpl(
RuntimeException(message.toString())
}
else -> this
}.apply { stackTrace = Thread.currentThread().stackTrace }
}
newError.stackTrace = Thread.currentThread().stackTrace
newError.addSuppressed(this)

return newError
}

private fun isWebViewException(throwable: Throwable): Boolean {
Expand Down

0 comments on commit af15496

Please sign in to comment.