Exception: Phone::Pbx::ApiError
- Inherits:
-
StandardError
- Object
- StandardError
- Phone::Pbx::ApiError
- Defined in:
- app/services/phone/pbx.rb
Overview
Raised internally (and reported to AppSignal via ErrorReporting) when a
Switchvox request fails — non-2xx HTTP, malformed JSON, connection/timeout,
or a Switchvox-side error object in the JSON body. Callers still get a
PbxResponse(success: false, …) back, but the exception is surfaced as an
AppSignal incident so we don't silently lose a Switchvox-side outage again
(see 2026-06-09: ACL allowlist mismatch returned 403 forbidden.html for ~24h
while every dashboard looked green).
Instance Attribute Summary collapse
-
#api_method ⇒ Object
readonly
Returns the value of attribute api_method.
-
#body_snippet ⇒ Object
readonly
Returns the value of attribute body_snippet.
-
#http_status ⇒ Object
readonly
Returns the value of attribute http_status.
Instance Method Summary collapse
-
#initialize(api_method:, http_status: nil, body_snippet: nil, cause_message: nil) ⇒ ApiError
constructor
A new instance of ApiError.
Constructor Details
#initialize(api_method:, http_status: nil, body_snippet: nil, cause_message: nil) ⇒ ApiError
Returns a new instance of ApiError.
26 27 28 29 30 31 32 33 34 |
# File 'app/services/phone/pbx.rb', line 26 def initialize(api_method:, http_status: nil, body_snippet: nil, cause_message: nil) @api_method = api_method @http_status = http_status @body_snippet = body_snippet parts = ["pbx:#{api_method}"] parts << "http=#{http_status}" if http_status parts << if super(parts.join(' ')) end |
Instance Attribute Details
#api_method ⇒ Object (readonly)
Returns the value of attribute api_method.
24 25 26 |
# File 'app/services/phone/pbx.rb', line 24 def api_method @api_method end |
#body_snippet ⇒ Object (readonly)
Returns the value of attribute body_snippet.
24 25 26 |
# File 'app/services/phone/pbx.rb', line 24 def body_snippet @body_snippet end |
#http_status ⇒ Object (readonly)
Returns the value of attribute http_status.
24 25 26 |
# File 'app/services/phone/pbx.rb', line 24 def http_status @http_status end |