Method: Lookout::Results::Error::Exception#message
- Defined in:
- lib/lookout/results/error/exception.rb
#message ⇒ Object
10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 |
# File 'lib/lookout/results/error/exception.rb', line 10 def # Chomping off a \n here isn’t 100 percent compatible with how Ruby 1.9 # does it, but it simplifies the code and also makes the output better if # the message is a lone \n. = @exception..to_str.chomp("\n") if @exception.class == RuntimeError and .empty? 'unhandled exception' elsif .empty? @exception.class.name elsif @exception.class.name.empty? or @exception.class.name =~ /^#/ else before, newline, after = .partition("\n") '%s (%s)%s%s' % [before, @exception.class.name, newline, after] end end |