Class: OSTSdk::Util::CustomErrorResponse
- Inherits:
-
Object
- Object
- OSTSdk::Util::CustomErrorResponse
- Defined in:
- lib/ost-sdk-ruby/util/custom_error_response.rb
Instance Method Summary collapse
- #default_error_response ⇒ Object
- #external_error_response ⇒ Object
-
#initialize(params) ⇒ CustomErrorResponse
constructor
A new instance of CustomErrorResponse.
- #timeout_error_response ⇒ Object
Constructor Details
#initialize(params) ⇒ CustomErrorResponse
Returns a new instance of CustomErrorResponse.
8 9 10 11 12 13 |
# File 'lib/ost-sdk-ruby/util/custom_error_response.rb', line 8 def initialize(params) @code = params[:code] @internal_id = params[:internal_id] @msg = params[:msg] @error_data = params[:error_data] end |
Instance Method Details
#default_error_response ⇒ Object
25 26 27 28 29 30 31 32 |
# File 'lib/ost-sdk-ruby/util/custom_error_response.rb', line 25 def default_error_response error_response({ :code => 'SOMETHING_WENT_WRONG', :internal_id => "SDK(#{@internal_id})", :msg => @msg, :error_data => [] }) end |
#external_error_response ⇒ Object
16 17 18 19 20 21 22 23 |
# File 'lib/ost-sdk-ruby/util/custom_error_response.rb', line 16 def external_error_response error_response({ :code => @code, :internal_id => @internal_id, :msg => @msg, :error_data => @error_data }) end |
#timeout_error_response ⇒ Object
34 35 36 37 38 39 40 41 |
# File 'lib/ost-sdk-ruby/util/custom_error_response.rb', line 34 def timeout_error_response error_response({ :code => 'REQUEST_TIMEOUT', :internal_id => "SDK(REQUEST_TIMEOUT)", :msg => '', :error_data => [] }) end |