Skip to content

Commit 51cba8e

Browse files
authored
doc: add error message (#691)
1 parent b9bb275 commit 51cba8e

File tree

2 files changed

+5
-1
lines changed

2 files changed

+5
-1
lines changed

lib/appium_lib/core/common/error.rb

+2
Original file line numberDiff line numberDiff line change
@@ -3,9 +3,11 @@ module Core
33
module Error
44
class CoreError < StandardError; end
55

6+
# Capability related errors
67
class NoCapabilityError < CoreError; end
78
class CapabilityStructureError < CoreError; end
89

10+
# Appium related errors
911
class NotSupportedAppiumServer < CoreError; end
1012
class NoSuchElementError < CoreError; end
1113

lib/appium_lib/core/driver.rb

+3-1
Original file line numberDiff line numberDiff line change
@@ -254,7 +254,9 @@ def validate_keys(opts)
254254
flatten_ops = flatten_hash_keys(opts)
255255

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

259261
true
260262
end

0 commit comments

Comments
 (0)