Created
December 6, 2023 15:58
-
-
Save caius/59b8afa9e1917c706e59e04668bdb5ee 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
Error = Class.new(StandardError) | |
class Client | |
Error = Class.new(StandardError) | |
def call | |
raise "ZOMG" | |
rescue => e | |
raise Error.new("Uh oh #{e.inspect}") | |
end | |
end | |
begin | |
Client.new.call | |
rescue Client::Error => e | |
raise ::Error.new("Uh oh #{e.inspect}") | |
end |
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
tmp/raise-cause.rb:16:in `rescue in <main>': Uh oh #<Client::Error: Uh oh #<RuntimeError: ZOMG>> (Error) | |
from tmp/raise-cause.rb:13:in `<main>' | |
tmp/raise-cause.rb:9:in `rescue in call': Uh oh #<RuntimeError: ZOMG> (Client::Error) | |
from tmp/raise-cause.rb:6:in `call' | |
from tmp/raise-cause.rb:14:in `<main>' | |
tmp/raise-cause.rb:7:in `call': ZOMG (RuntimeError) | |
from tmp/raise-cause.rb:14:in `<main>' |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment