Module: HumanistErrors::ExceptionExtensions

Defined in:
lib/humanist_errors/exception_extensions.rb

Instance Method Summary collapse

Instance Method Details

#to_sObject



3
4
5
6
7
8
9
10
11
12
13
# File 'lib/humanist_errors/exception_extensions.rb', line 3

def to_s
  error = Search.run(self.class, super)
  if :no_result == error
    super
  else
    color = Color.new
    "\n\n#{STARTING_TOKEN}" \
    " #{color.cyan(error)}\n" \
    "#{ENDING_TOKEN}\n" + super
  end
end