Exception: TaxCloud::Errors::TaxCloudError
- Inherits:
-
StandardError
- Object
- StandardError
- TaxCloud::Errors::TaxCloudError
- Defined in:
- lib/tax_cloud/errors/tax_cloud_error.rb
Overview
Default parent TaxCloud error for all custom errors. This handles the base key for the translations and provides the convenience method for translating the messages.
Generously borrowed from Mongoid.
Direct Known Subclasses
ApiError, MissingConfig, MissingConfigOption, SoapError, UnexpectedSoapResponse
Instance Attribute Summary collapse
-
#problem ⇒ Object
readonly
Problem occurred.
-
#resolution ⇒ Object
readonly
Suggested problem resolution.
-
#summary ⇒ Object
readonly
Summary of the problem.
Instance Method Summary collapse
-
#compose_message(key, attributes = {}) ⇒ Object
Compose the message.
Instance Attribute Details
#problem ⇒ Object (readonly)
Problem occurred.
11 12 13 |
# File 'lib/tax_cloud/errors/tax_cloud_error.rb', line 11 def problem @problem end |
#resolution ⇒ Object (readonly)
Suggested problem resolution.
17 18 19 |
# File 'lib/tax_cloud/errors/tax_cloud_error.rb', line 17 def resolution @resolution end |
#summary ⇒ Object (readonly)
Summary of the problem.
14 15 16 |
# File 'lib/tax_cloud/errors/tax_cloud_error.rb', line 14 def summary @summary end |
Instance Method Details
#compose_message(key, attributes = {}) ⇒ Object
Compose the message.
Parameters
- key
-
Lookup key in the translation table.
- attributes
-
The objects to pass to create the message.
23 24 25 26 27 28 29 30 31 |
# File 'lib/tax_cloud/errors/tax_cloud_error.rb', line 23 def (key, attributes = {}) @problem = create_problem(key, attributes) @summary = create_summary(key, attributes) @resolution = create_resolution(key, attributes) "\nProblem:\n #{@problem}" + "\nSummary:\n #{@summary}" + "\nResolution:\n #{@resolution}" end |