You can actually pass the original exception's backtrace here in order to preserve where the original error occurred. See https://github.com/puppetlabs/puppet/blob/master/lib/puppet/network/format_support.rb#L13 for an example.