Exception: Tester::GlobalTestException
- Inherits:
-
APIException
- Object
- StandardError
- APIException
- Tester::GlobalTestException
- Defined in:
- lib/tester/exceptions/global_test_exception.rb
Overview
To test specific global exceptions.
Direct Known Subclasses
Instance Attribute Summary collapse
-
#server_code ⇒ Integer
Represents the server’s error code.
-
#server_message ⇒ String
Represents the server’s exception message.
Attributes inherited from APIException
Instance Method Summary collapse
-
#initialize(reason, context) ⇒ GlobalTestException
constructor
The constructor.
-
#unbox(hash) ⇒ Object
Populates this object by extracting properties from a hash.
Constructor Details
#initialize(reason, context) ⇒ GlobalTestException
The constructor.
18 19 20 21 22 |
# File 'lib/tester/exceptions/global_test_exception.rb', line 18 def initialize(reason, context) super(reason, context) hash = APIHelper.json_deserialize(@context.response.raw_body) unbox(hash) end |
Instance Attribute Details
#server_code ⇒ Integer
Represents the server’s error code
13 14 15 |
# File 'lib/tester/exceptions/global_test_exception.rb', line 13 def server_code @server_code end |
#server_message ⇒ String
Represents the server’s exception message
9 10 11 |
# File 'lib/tester/exceptions/global_test_exception.rb', line 9 def @server_message end |
Instance Method Details
#unbox(hash) ⇒ Object
Populates this object by extracting properties from a hash. response body.
27 28 29 30 |
# File 'lib/tester/exceptions/global_test_exception.rb', line 27 def unbox(hash) @server_message = hash['ServerMessage'] @server_code = hash['ServerCode'] end |