Skip to content

Instantly share code, notes, and snippets.

@roodion
Last active March 22, 2017 11:58
Show Gist options
  • Select an option

  • Save roodion/e47eb4a322b84c333cd27ac03e575b4b to your computer and use it in GitHub Desktop.

Select an option

Save roodion/e47eb4a322b84c333cd27ac03e575b4b to your computer and use it in GitHub Desktop.
class NException < StandardError
attr_reader :inner_exception
def initialize(message, inner_exception = nil)
super(message)
@inner_exception = inner_exception
end
end
def sasi
begin
p 'begin'
raise NException.new('first_exception')
rescue => ex
e = NException.new('sasi in rescue', ex)
raise e
end
end
begin
sasi()
rescue => ex
pp ex.backtrace
pp ex.inner_exception.backtrace
end;1
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment