I wonder if `expectCatching { … }.isA<BlahExce...
# strikt
c
I wonder if
expectCatching { … }.isA<BlahException>
should rethrow the exception if its not the expected exception, or at least show the stacktrace of the unexpected exception
r
That would make sense. It would. require exception-specific logic in
isA
although it’s
expectCatching { … }.isFailure().isA<Whatever>()
and then you. can just do
expectCatching { … }.failedWith<WhateverException>()
although that’s just an alias for the former
c
right now i comment out the expect to get the stacktrace of an unexpected exceptiomn
r
I wonder if it makes sense to customize how
failedWith
works?
rather than introduce exception-specific logic into
isA
c
hmm isnt the exception printed with the pretty printer anyway? why not just change the pretty-printer to print exceptions with stack trace
(by pretty printer i mean
Formatting.formatValue
)
r
hmm yeah. That would do it