Exception: LifenFhir::Error
- Inherits:
-
StandardError
- Object
- StandardError
- LifenFhir::Error
- Defined in:
- lib/lifen_fhir/error.rb
Instance Attribute Summary collapse
-
#params ⇒ Object
Returns the value of attribute params.
-
#response ⇒ Object
Returns the value of attribute response.
Instance Method Summary collapse
- #context ⇒ Object
-
#initialize(message:, response: nil, params: {}, client: "app", token: nil) ⇒ Error
constructor
A new instance of Error.
- #raven_context ⇒ Object
Constructor Details
#initialize(message:, response: nil, params: {}, client: "app", token: nil) ⇒ Error
Returns a new instance of Error.
7 8 9 10 11 12 13 14 15 |
# File 'lib/lifen_fhir/error.rb', line 7 def initialize(message: , response: nil, params: {}, client: "app", token: nil) self.response = response self.params = params @client = client @token = token super() end |
Instance Attribute Details
#params ⇒ Object
Returns the value of attribute params.
5 6 7 |
# File 'lib/lifen_fhir/error.rb', line 5 def params @params end |
#response ⇒ Object
Returns the value of attribute response.
5 6 7 |
# File 'lib/lifen_fhir/error.rb', line 5 def response @response end |
Instance Method Details
#context ⇒ Object
17 18 19 20 21 22 23 24 25 26 27 28 29 30 |
# File 'lib/lifen_fhir/error.rb', line 17 def context return {} if response.nil? { url: response.env.url.to_s, method: response.env.method.to_s, token: trucanted_token, payload_sent: filtered_params, trace_id: extracted_trace_id, payload_received: response.body, client: @client } end |
#raven_context ⇒ Object
32 33 34 35 36 |
# File 'lib/lifen_fhir/error.rb', line 32 def raven_context { :extra => { lifen: context } } end |