5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
|
# File 'lib/practical_errors/practicable.rb', line 5
def arrange_exception!(exception)
@customised_message = ''
abstract_original_message(exception)
if PracticalErrors::ErrorAdvisers::const_defined?(exception.class.to_s)
@customised_message << PracticalErrors::ErrorAdvisers::const_get(exception.class.to_s).advise(exception)
else
@customised_message << <<-"EOS".strip_heredoc
hmm... I don't know this error :(
Tell me => https://github.com/serihiro/practical_errors
EOS
end
exception.message.gsub!(/.+/, @customised_message)
end
|