Exception: MsRest2::DeserializationError
- Defined in:
- lib/ms_rest2/deserialization_error.rb
Overview
Class which represents an error happening during deserialization of server response.
Instance Attribute Summary collapse
-
#exception_message ⇒ String
The inner exception message.
-
#exception_stacktrace ⇒ String
The inner exception stacktrace.
-
#result ⇒ MsRest2::HttpOperationResponse
Server response which client was unable to parse.
Instance Method Summary collapse
-
#initialize(msg, exception_message, exception_stacktrace, result) ⇒ DeserializationError
constructor
Creates and initialize new instance of the DeserializationError class.
- #to_json(*a) ⇒ Object
- #to_s ⇒ Object
Constructor Details
#initialize(msg, exception_message, exception_stacktrace, result) ⇒ DeserializationError
Creates and initialize new instance of the DeserializationError class.
27 28 29 30 31 32 |
# File 'lib/ms_rest2/deserialization_error.rb', line 27 def initialize(msg, , exception_stacktrace, result) @msg = msg || self.class.name @exception_message = @exception_stacktrace = exception_stacktrace @result = result end |
Instance Attribute Details
#exception_message ⇒ String
Returns the inner exception message.
13 14 15 |
# File 'lib/ms_rest2/deserialization_error.rb', line 13 def @exception_message end |
#exception_stacktrace ⇒ String
Returns the inner exception stacktrace.
16 17 18 |
# File 'lib/ms_rest2/deserialization_error.rb', line 16 def exception_stacktrace @exception_stacktrace end |
#result ⇒ MsRest2::HttpOperationResponse
Returns server response which client was unable to parse.
19 20 21 |
# File 'lib/ms_rest2/deserialization_error.rb', line 19 def result @result end |
Instance Method Details
#to_json(*a) ⇒ Object
34 35 36 |
# File 'lib/ms_rest2/deserialization_error.rb', line 34 def to_json(*a) {exception_message: , message: @msg, stacktrace: exception_stacktrace, result: result}.to_json(*a) end |
#to_s ⇒ Object
38 39 40 |
# File 'lib/ms_rest2/deserialization_error.rb', line 38 def to_s JSON.pretty_generate(self) end |