@@ -16,7 +16,7 @@ def initialize
16
16
'Name' => 'Veeder-Root Automatic Tank Gauge (ATG) Administrative Client' ,
17
17
'Description' => %q{
18
18
This module acts as a simplistic administrative client for interfacing
19
- with Veeder-Root Automatic Tang Gauges (ATGs) or other devices speaking
19
+ with Veeder-Root Automatic Tank Gauges (ATGs) or other devices speaking
20
20
the TLS-250 and TLS-350 protocols. This has been tested against
21
21
GasPot, a honeypot meant to simulate ATGs; it has not been tested
22
22
against anything else, so use at your own risk.
@@ -170,12 +170,18 @@ def initialize
170
170
171
171
def setup
172
172
# ensure that the specified command is implemented for the desired version of the TLS protocol
173
- fail "#{ action . name } not defined for #{ protocol } " unless action . opts . keys . include? ( protocol_opt_name )
173
+ unless action . opts . keys . include? ( protocol_opt_name )
174
+ fail_with ( Failure ::BadConfig , "#{ action . name } not defined for #{ protocol } " )
175
+ end
174
176
175
177
# ensure that the tank number is set for the commands that need it
176
- fail "TANK_NUMBER #{ tank_number } is invalid" if action . name == 'SET_TANK_NAME' && ( tank_number < 0 || tank_number > 99 )
178
+ if action . name == 'SET_TANK_NAME' && ( tank_number < 0 || tank_number > 99 )
179
+ fail_with ( Failure ::BadConfig , "TANK_NUMBER #{ tank_number } is invalid" )
180
+ end
177
181
178
- fail "Invalid timeout #{ timeout } -- must be > 0" unless timeout > 0
182
+ unless timeout > 0
183
+ fail_with ( Failure ::BadConfig , "Invalid timeout #{ timeout } -- must be > 0" )
184
+ end
179
185
end
180
186
181
187
def get_response ( request )
0 commit comments