Skip to content

Commit b936d01

Browse files
committed
tweak error messages in emulator module
1 parent a17be27 commit b936d01

File tree

2 files changed

+5
-2
lines changed

2 files changed

+5
-2
lines changed

CHANGELOG.md

+1
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@ Read `release_notes.md` for commit level details.
55
## [Unreleased]
66

77
### Enhancements
8+
- [internal] Tweak error messages in emulator module
89

910
### Bug fixes
1011

lib/appium_lib_core/android/device/emulator.rb

+4-2
Original file line numberDiff line numberDiff line change
@@ -131,7 +131,7 @@ def gsm_call(phone_number:, action:)
131131

132132
::Appium::Core::Device.add_endpoint_method(:gsm_signal) do
133133
def gsm_signal(signal_strength)
134-
raise "#{signal_strength} should be member of #{GSM_SIGNALS} " if GSM_SIGNALS[signal_strength.to_sym].nil?
134+
raise "#{signal_strength} should be member of #{GSM_SIGNALS.keys} " if GSM_SIGNALS[signal_strength.to_sym].nil?
135135

136136
execute(:gsm_signal, {}, { signalStrength: GSM_SIGNALS[signal_strength],
137137
signalStrengh: GSM_SIGNALS[signal_strength] })
@@ -158,7 +158,9 @@ def set_network_speed(netspeed)
158158

159159
::Appium::Core::Device.add_endpoint_method(:set_power_capacity) do
160160
def set_power_capacity(percent)
161-
raise "The percent should be between 0 and 100. Not #{percent}." unless (0..100).member? percent
161+
unless (0..100).member? percent
162+
::Appium::Logger.warn "The percent should be between 0 and 100. Not #{percent}."
163+
end
162164

163165
execute(:set_power_capacity, {}, { percent: percent })
164166
end

0 commit comments

Comments
 (0)