Exception: Droonga::MessageProcessingError
- Inherits:
-
StandardError
- Object
- StandardError
- Droonga::MessageProcessingError
- Defined in:
- lib/droonga/message_processing_error.rb
Direct Known Subclasses
Constant Summary collapse
- STATUS_CODE =
500
Instance Attribute Summary collapse
-
#detail ⇒ Object
readonly
Returns the value of attribute detail.
-
#message ⇒ Object
readonly
Returns the value of attribute message.
Instance Method Summary collapse
-
#initialize(message, detail = nil) ⇒ MessageProcessingError
constructor
A new instance of MessageProcessingError.
- #name ⇒ Object
- #response_body ⇒ Object
- #status_code ⇒ Object
Constructor Details
#initialize(message, detail = nil) ⇒ MessageProcessingError
Returns a new instance of MessageProcessingError.
22 23 24 25 |
# File 'lib/droonga/message_processing_error.rb', line 22 def initialize(, detail=nil) = @detail = detail end |
Instance Attribute Details
#detail ⇒ Object (readonly)
Returns the value of attribute detail.
20 21 22 |
# File 'lib/droonga/message_processing_error.rb', line 20 def detail @detail end |
#message ⇒ Object (readonly)
Returns the value of attribute message.
20 21 22 |
# File 'lib/droonga/message_processing_error.rb', line 20 def end |
Instance Method Details
#name ⇒ Object
27 28 29 |
# File 'lib/droonga/message_processing_error.rb', line 27 def name self.class.name.split("::").last end |
#response_body ⇒ Object
35 36 37 38 39 40 41 42 |
# File 'lib/droonga/message_processing_error.rb', line 35 def response_body body = { "name" => name, "message" => , } body["detail"] = @detail unless @detail.nil? body end |
#status_code ⇒ Object
31 32 33 |
# File 'lib/droonga/message_processing_error.rb', line 31 def status_code self.class::STATUS_CODE end |