Sometimes our custom errors wrap an underlying error and try to show the wrapped error and backtrace. See for example https://github.com/rubygems/rubygems/blob/c63c4b0305de7a5712436d37decca648b14b0091/bundler/lib/bundler/errors.rb#L134-L148.
@segiddins suggested that we may be able to use Exception#detailed_message to show the cause instead. I noticed that it's only available in newer rubies, but we could gradually move to that if it simplifies things. I also noticed there's Exception#full_message that includes the backtrace.
We should evaluate whether this makes sense for us and will simplify our errors, or whether we should not bother.
Sometimes our custom errors wrap an underlying error and try to show the wrapped error and backtrace. See for example https://github.com/rubygems/rubygems/blob/c63c4b0305de7a5712436d37decca648b14b0091/bundler/lib/bundler/errors.rb#L134-L148.
@segiddins suggested that we may be able to use
Exception#detailed_messageto show the cause instead. I noticed that it's only available in newer rubies, but we could gradually move to that if it simplifies things. I also noticed there'sException#full_messagethat includes the backtrace.We should evaluate whether this makes sense for us and will simplify our errors, or whether we should not bother.