class SomeCustomException < StandardError
def initialize(msg = "Some default error message")
super
end
end
def this_will_fail
raise SomeCustomException.new("This will be the error message")
rescue SomeCustomException => e
p e.message # => This will be the error message
end