notepadqq_api 0.1.4 → 0.1.5
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/lib/notepadqq_api/message_interpreter.rb +20 -11
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: e90239d4a2cbf53393b8a9f814108d03cec8abfe
|
4
|
+
data.tar.gz: 13c5fbd3964d85f68e13af039370c94246cd7f7b
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: e1f59f96c84be1cbd10ee72519c210a1402ba32dcfb91df07bc56ca5a7aae3ca8fa7e7dcdcaf126c7d7ed76b4f50caf29ea07c9bfb7839883117436ece024d8e
|
7
|
+
data.tar.gz: f7f1e3969e857e0915ec1479d5cb661905d65bacc9137aba54a20160a03c6c2ca1f55c4a2972673203e6fc93042c85e68f8223522d9515fa8f89d47bf07e6c5f
|
@@ -41,7 +41,7 @@ class NotepadqqApi
|
|
41
41
|
result = result[0]
|
42
42
|
|
43
43
|
if reply["err"] != MessageInterpreterError::ErrorCode::NONE
|
44
|
-
error = MessageInterpreterError.new(reply["err"])
|
44
|
+
error = MessageInterpreterError.new(reply["err"], reply["errStr"])
|
45
45
|
raise error, error.description
|
46
46
|
end
|
47
47
|
|
@@ -127,22 +127,31 @@ class NotepadqqApi
|
|
127
127
|
end
|
128
128
|
|
129
129
|
attr_reader :error_code
|
130
|
+
attr_reader :error_string
|
130
131
|
|
131
|
-
def initialize(error_code)
|
132
|
+
def initialize(error_code, error_string)
|
132
133
|
@error_code = error_code
|
134
|
+
@error_string = error_string
|
133
135
|
end
|
134
136
|
|
135
137
|
def description
|
136
|
-
|
137
|
-
|
138
|
-
|
139
|
-
|
140
|
-
|
141
|
-
|
142
|
-
|
143
|
-
|
144
|
-
|
138
|
+
str_code =
|
139
|
+
case @error_code
|
140
|
+
when ErrorCode::NONE then "None"
|
141
|
+
when ErrorCode::INVALID_REQUEST then "Invalid request"
|
142
|
+
when ErrorCode::INVALID_ARGUMENT_NUMBER then "Invalid argument number"
|
143
|
+
when ErrorCode::INVALID_ARGUMENT_TYPE then "Invalid argument type"
|
144
|
+
when ErrorCode::OBJECT_DEALLOCATED then "Object deallocated"
|
145
|
+
when ErrorCode::OBJECT_NOT_FOUND then "Object not found"
|
146
|
+
when ErrorCode::METHOD_NOT_FOUND then "Method not found"
|
147
|
+
else "Unknown error"
|
148
|
+
end
|
149
|
+
|
150
|
+
unless @error_string.nil? || @error_string.empty?
|
151
|
+
str_code += ': ' + @error_string
|
145
152
|
end
|
153
|
+
|
154
|
+
str_code
|
146
155
|
end
|
147
156
|
|
148
157
|
end
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: notepadqq_api
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.1.
|
4
|
+
version: 0.1.5
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Daniele Di Sarli
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2015-05-
|
11
|
+
date: 2015-05-04 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: json
|