Last active
March 22, 2017 11:58
-
-
Save roodion/e47eb4a322b84c333cd27ac03e575b4b to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| 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