Class: Mutx::Support::ErrorHandlerHelper

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

Class Method Summary collapse

Class Method Details

.evaluate(exception) ⇒ Object



6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
# File 'lib/mutx/support/error_handler_helper.rb', line 6

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 Mutx::Error::TaskNotFound
      ["Task Name Error",exception.message]
    when Mutx::Error::Result
      ["Result Error", excetion.message]
    when Mutx::Error::MutxFile
      ["Mutx File", exception.message]
    when Mutx::Error::MutxDir
      ["Mutx File", exception.message]
    when Mutx::Error::Help
      ["Help Error", exception.message]
    else
      ["Unknown Error", "#{exception.message}#{exception.backtrace}"]
  end
end