Class: Selenium::WebDriver::Remote::Response

Inherits:
Object
  • Object
show all
Defined in:
lib/appium_lib/common/patch.rb

Overview

Print Appium’s origValue error messages.

Instance Method Summary collapse

Instance Method Details

#error_messageObject



155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
# File 'lib/appium_lib/common/patch.rb', line 155

def error_message
  val = value

  case val
    when Hash
      msg = val['origValue'] || val['message'] or return 'unknown error'
      msg << " (#{ val['class'] })" if val['class']
    when String
      msg = val
    else
      msg = "unknown error, status=#{status}: #{val.inspect}"
  end

  msg
end