Skip to content

Commit

Permalink
doc: add error message (#691)
Browse files Browse the repository at this point in the history
  • Loading branch information
KazuCocoa authored Oct 7, 2017
1 parent b9bb275 commit 51cba8e
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 1 deletion.
2 changes: 2 additions & 0 deletions lib/appium_lib/core/common/error.rb
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,11 @@ module Core
module Error
class CoreError < StandardError; end

# Capability related errors
class NoCapabilityError < CoreError; end
class CapabilityStructureError < CoreError; end

# Appium related errors
class NotSupportedAppiumServer < CoreError; end
class NoSuchElementError < CoreError; end

Expand Down
4 changes: 3 additions & 1 deletion lib/appium_lib/core/driver.rb
Original file line number Diff line number Diff line change
Expand Up @@ -254,7 +254,9 @@ def validate_keys(opts)
flatten_ops = flatten_hash_keys(opts)

raise Error::NoCapabilityError unless opts.member?(:caps)
raise Error::CapabilityStructureError if !opts.member?(:appium_lib) && flatten_ops.member?(:appium_lib)
if !opts.member?(:appium_lib) && flatten_ops.member?(:appium_lib)
raise Error::CapabilityStructureError, 'Please check the value of appium_lib in the capability'
end

true
end
Expand Down

0 comments on commit 51cba8e

Please sign in to comment.