Exception: Cxf::Errors::ServiceError
- Inherits:
-
RuntimeError
- Object
- RuntimeError
- Cxf::Errors::ServiceError
- Defined in:
- lib/errors.rb
Direct Known Subclasses
AccessDeniedException, InternalServerException, MethodNotAllowedException, ResourceNotFoundException, UndefinedIdException, ValidationException
Instance Attribute Summary collapse
-
#client ⇒ Object
readonly
Returns the value of attribute client.
- #detail ⇒ String readonly
-
#http_status ⇒ Object
readonly
Returns the value of attribute http_status.
-
#response ⇒ Object
readonly
Returns the value of attribute response.
-
#title ⇒ Object
readonly
Returns the value of attribute title.
Instance Method Summary collapse
-
#initialize(client, title, detail, http_status, response) ⇒ ServiceError
constructor
A new instance of ServiceError.
- #to_h(extra_fields = {}) ⇒ Object
- #to_s ⇒ Object
Constructor Details
#initialize(client, title, detail, http_status, response) ⇒ ServiceError
Returns a new instance of ServiceError.
43 44 45 46 47 48 49 50 51 |
# File 'lib/errors.rb', line 43 def initialize(client, title, detail, http_status, response) @title = title @client = client @response = response @http_status = http_status @detail = detail && !detail.empty? ? detail : self.class.to_s super(@detail) end |
Instance Attribute Details
#client ⇒ Object (readonly)
Returns the value of attribute client.
74 75 76 |
# File 'lib/errors.rb', line 74 def client @client end |
#detail ⇒ String (readonly)
54 55 56 |
# File 'lib/errors.rb', line 54 def detail @detail end |
#http_status ⇒ Object (readonly)
Returns the value of attribute http_status.
74 75 76 |
# File 'lib/errors.rb', line 74 def http_status @http_status end |
#response ⇒ Object (readonly)
Returns the value of attribute response.
74 75 76 |
# File 'lib/errors.rb', line 74 def response @response end |
#title ⇒ Object (readonly)
Returns the value of attribute title.
74 75 76 |
# File 'lib/errors.rb', line 74 def title @title end |
Instance Method Details
#to_h(extra_fields = {}) ⇒ Object
58 59 60 61 62 63 64 65 66 67 68 |
# File 'lib/errors.rb', line 58 def to_h(extra_fields = {}) default_fields = { client: client, title: title, detail: detail, http_status: http_status, response: response } default_fields.merge(extra_fields) end |
#to_s ⇒ Object
70 71 72 |
# File 'lib/errors.rb', line 70 def to_s to_h.to_s end |