Skip to content

Instantly share code, notes, and snippets.

@civitaspo
Last active July 27, 2016 09:34
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save civitaspo/8b2ca6607db3ad8e055cf47b2b82a6bf to your computer and use it in GitHub Desktop.
Save civitaspo/8b2ca6607db3ad8e055cf47b2b82a6bf to your computer and use it in GitHub Desktop.
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
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