Permalink
Browse files

BERTRPCError gives self for original_exception if nil

This fixes issues with newrelic and some other code that
assumes original_exception will be non-nil if the exception
respond_to?(:original_exception)
  • Loading branch information...
1 parent 95f93c3 commit 1fa39a658712fb5f257ff4cb7894c184531f104b @rtomayko rtomayko committed Feb 5, 2010
Showing with 2 additions and 0 deletions.
  1. +2 −0 lib/bertrpc/errors.rb
@@ -13,6 +13,8 @@ def initialize(msg = nil, klass = nil, bt = [])
if klass
self.original_exception = RemoteError.new("#{klass}: #{message}")
self.original_exception.set_backtrace(bt)
+ else
+ self.original_exception = self
end
self.code = code

0 comments on commit 1fa39a6

Please sign in to comment.