Exception: Broadcast::WarningError
- Defined in:
- lib/broadcast/errors.rb
Overview
Raised instead of returning when config.warnings_mode is :raise and a 2xx response carried warnings. The request DID succeed — the write happened. Callers rescuing this must not assume anything was rolled back.
Instance Attribute Summary collapse
-
#response ⇒ Object
readonly
Returns the value of attribute response.
-
#warnings ⇒ Object
readonly
Returns the value of attribute warnings.
Instance Method Summary collapse
-
#initialize(warnings, response = nil) ⇒ WarningError
constructor
A new instance of WarningError.
Constructor Details
#initialize(warnings, response = nil) ⇒ WarningError
Returns a new instance of WarningError.
43 44 45 46 47 |
# File 'lib/broadcast/errors.rb', line 43 def initialize(warnings, response = nil) @warnings = warnings @response = response super("API returned #{warnings.size} warning(s): #{warnings.join('; ')}") end |
Instance Attribute Details
#response ⇒ Object (readonly)
Returns the value of attribute response.
41 42 43 |
# File 'lib/broadcast/errors.rb', line 41 def response @response end |
#warnings ⇒ Object (readonly)
Returns the value of attribute warnings.
41 42 43 |
# File 'lib/broadcast/errors.rb', line 41 def warnings @warnings end |