Exception: NotepadqqApi::MessageInterpreterError
- Inherits:
-
RuntimeError
- Object
- RuntimeError
- NotepadqqApi::MessageInterpreterError
- Defined in:
- lib/notepadqq_api/message_interpreter.rb
Defined Under Namespace
Modules: ErrorCode
Instance Attribute Summary collapse
-
#error_code ⇒ Object
readonly
Returns the value of attribute error_code.
-
#error_string ⇒ Object
readonly
Returns the value of attribute error_string.
Instance Method Summary collapse
- #description ⇒ Object
-
#initialize(error_code, error_string) ⇒ MessageInterpreterError
constructor
A new instance of MessageInterpreterError.
Constructor Details
#initialize(error_code, error_string) ⇒ MessageInterpreterError
Returns a new instance of MessageInterpreterError.
132 133 134 135 |
# File 'lib/notepadqq_api/message_interpreter.rb', line 132 def initialize(error_code, error_string) @error_code = error_code @error_string = error_string end |
Instance Attribute Details
#error_code ⇒ Object (readonly)
Returns the value of attribute error_code.
129 130 131 |
# File 'lib/notepadqq_api/message_interpreter.rb', line 129 def error_code @error_code end |
#error_string ⇒ Object (readonly)
Returns the value of attribute error_string.
130 131 132 |
# File 'lib/notepadqq_api/message_interpreter.rb', line 130 def error_string @error_string end |
Instance Method Details
#description ⇒ Object
137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 |
# File 'lib/notepadqq_api/message_interpreter.rb', line 137 def description str_code = case @error_code when ErrorCode::NONE then "None" when ErrorCode::INVALID_REQUEST then "Invalid request" when ErrorCode::INVALID_ARGUMENT_NUMBER then "Invalid argument number" when ErrorCode::INVALID_ARGUMENT_TYPE then "Invalid argument type" when ErrorCode::OBJECT_DEALLOCATED then "Object deallocated" when ErrorCode::OBJECT_NOT_FOUND then "Object not found" when ErrorCode::METHOD_NOT_FOUND then "Method not found" else "Unknown error" end unless @error_string.nil? || @error_string.empty? str_code += ': ' + @error_string end str_code end |