Last active
July 27, 2016 09:34
-
-
Save civitaspo/8b2ca6607db3ad8e055cf47b2b82a6bf to your computer and use it in GitHub Desktop.
This file contains 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
require 'embulk' | |
Embulk.setup | |
class MyError1 < ::Embulk::DataError; end | |
class MyError2 < ::Embulk::DataError; end | |
begin | |
raise MyError1.new("hoge") | |
rescue MyError2 => e | |
puts "Why come here? error_class => #{e.class}, rescue MyError2." | |
puts "e.kind_of?(MyError1) #=> #{e.kind_of?(MyError1)}" | |
puts "e.kind_of?(MyError2) #=> #{e.kind_of?(MyError2)}" | |
end |
This file contains 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
Why come here? error_class => MyError1, rescue MyError2. | |
e.kind_of?(MyError1) #=> true | |
e.kind_of?(MyError2) #=> false |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment