Skip to content

Commit

Permalink
Merge pull request #661 from KasperskyLab/ISSUE-639-Attach-original-e…
Browse files Browse the repository at this point in the history
…xception

ISSUE-639: Attach original exception as a suppressed one
  • Loading branch information
CherchesovAzamat authored Aug 20, 2024
2 parents 43ab869 + af15496 commit 8185355
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 8185355

Please sign in to comment.