Class: Kaya::Support::ErrorHandlerHelper

Inherits:
Object
  • Object
show all
Defined in:
lib/kaya/support/error_handler_helper.rb

Class Method Summary collapse

Class Method Details

.evaluate(exception) ⇒ Object



5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
# File 'lib/kaya/support/error_handler_helper.rb', line 5

def self.evaluate exception
  case exception
    when Mongo::ConnectionTimeoutError
      ["Timeout Error","Could not connect to database"]
    when Psych::SyntaxError
      ["Parse Error","Cucumber.yml file is not configured correctly (#{exception.message})"]
    when Kaya::Error::Suite
      ["Suite Name Error",exception.message]
    when Kaya::Error::CucumberYML
      ["No Cucumber file", exception.message]
    else
      message = "#{exception.message}#{exception.backtrace}"
      ["Unknown Error", message]
  end
end