squash_matrix 1.0.7 → 1.0.8
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/Gemfile.lock +1 -1
- data/lib/squash_matrix/client.rb +7 -1
- data/lib/squash_matrix/constants.rb +1 -0
- data/lib/squash_matrix/errors.rb +1 -0
- data/lib/squash_matrix/version.rb +1 -1
- metadata +1 -1
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: e39c810538e0cccb7d8418eae458e164cda33854d1f2fc56e841aeaf13078e8f
|
|
4
|
+
data.tar.gz: e76295af2406401e89a43c32e8bde72e20e2ebe315c9ead1eaa7a95b34551104
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: f472a5010c4a1d3d061e179dd6a7385038ff13b7cfa8b42e8ed1f872a22a7083eee3507e4401024a7dfdd03313d4d0cf0f2eb4b6dee23369e1408d65bfeae531
|
|
7
|
+
data.tar.gz: 1690abc95e59085ad37b50a8ed2f5d44dcd0cebf20fc153728de9f47acea7dc312d0afc1897c2ba20dea426f74ca4ce17eb2b086244eee6edfd16230eb1c2d52
|
data/Gemfile.lock
CHANGED
data/lib/squash_matrix/client.rb
CHANGED
|
@@ -186,12 +186,18 @@ module SquashMatrix
|
|
|
186
186
|
res = @request_client.start(uri.hostname, uri.port, use_ssl: uri.scheme == 'https') { |http| http.request(req) }
|
|
187
187
|
case res
|
|
188
188
|
when Net::HTTPSuccess, Net::HTTPFound
|
|
189
|
-
|
|
189
|
+
rtn = success_proc&.call(res) || res
|
|
190
|
+
raise SquashMatrix::Errors::EntityNotFoundError if rtn.is_a?(Array) &&
|
|
191
|
+
rtn.length == 0 &&
|
|
192
|
+
SquashMatrix::Constants::NOT_FOUND_REGEX.match(res.body)
|
|
193
|
+
return rtn
|
|
190
194
|
when Net::HTTPConflict
|
|
191
195
|
unless @suppress_errors
|
|
192
196
|
raise SquashMatrix::Errors::ForbiddenError, res.body if SquashMatrix::Constants::FORBIDDEN_ERROR_REGEX.match(res.body)
|
|
193
197
|
raise SquashMatrix::Errors::TooManyRequestsError, res.body if SquashMatrix::Constants::TOO_MANY_REQUESTS_ERROR_REGEX.match(res.body)
|
|
194
198
|
end
|
|
199
|
+
when Net::HTTPNotFound
|
|
200
|
+
raise SquashMatrix::Errors::EntityNotFoundError
|
|
195
201
|
else
|
|
196
202
|
raise SquashMatrix::Errors::UnknownError, res unless @suppress_errors
|
|
197
203
|
end
|
data/lib/squash_matrix/errors.rb
CHANGED