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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 1529b331a85e339351d5002099908bdcb33d528c
4
- data.tar.gz: 5222b4cef0fa9bd0b50d8db409cf7571588fbb54
3
+ metadata.gz: e90239d4a2cbf53393b8a9f814108d03cec8abfe
4
+ data.tar.gz: 13c5fbd3964d85f68e13af039370c94246cd7f7b
5
5
  SHA512:
6
- metadata.gz: 727a0d4bb12fd1bf7e588d0e4853b2ce646eab9fa65198f9d90318b579405a3cffc67ff0d0f35f28ce67bc763c003210aa75e58c405e6d0b37ccfd80ada05832
7
- data.tar.gz: c8c91d50253b9344a377a6bb5e42d84507f5e7116f6ba877d5dd90a63ea8180d178cf95a09f85419ab5a5aea6e421664952f8ad6eaf2e4004e3220241eb4ae84
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
- case @error_code
137
- when ErrorCode::NONE then "None"
138
- when ErrorCode::INVALID_REQUEST then "Invalid request"
139
- when ErrorCode::INVALID_ARGUMENT_NUMBER then "Invalid argument number"
140
- when ErrorCode::INVALID_ARGUMENT_TYPE then "Invalid argument type"
141
- when ErrorCode::OBJECT_DEALLOCATED then "Object deallocated"
142
- when ErrorCode::OBJECT_NOT_FOUND then "Object not found"
143
- when ErrorCode::METHOD_NOT_FOUND then "Method not found"
144
- else "Unknown error"
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
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-02 00:00:00.000000000 Z
11
+ date: 2015-05-04 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: json