translator-text 0.3.0 → 0.3.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/CHANGELOG.md +4 -0
- data/Gemfile.lock +1 -1
- data/lib/translator_text/client.rb +12 -15
- data/lib/translator_text/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 402064d43803ff2cdf50582b924de32b0a2252fa537a9bde2a9d9aff1eafc206
|
4
|
+
data.tar.gz: f297a6cf08cbeddd475a971c94e2564e03bddb7b5d2d53a338b1853ecb46014f
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 2133346bf4f959758e2ace99cfb2ef4c78aa057c248115ea82725d4b5e885019c4e36b380af3514e3e32467179261b28b5fe8f4829900e09318c462f2a5a7a7d
|
7
|
+
data.tar.gz: a315e3b0e877ddfe1ad399761e3ba5cec4b1d329ef5fd1554306733aa42c27bf5b1cd03e47b8cb68e5d09945b6a966e30b8df7505aad656e67dc6b9d9ba44d9a
|
data/CHANGELOG.md
CHANGED
@@ -4,6 +4,10 @@ All notable changes to this project will be documented in this file.
|
|
4
4
|
The format is based on [Keep a Changelog](http://keepachangelog.com/en/1.0.0/)
|
5
5
|
and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0.html).
|
6
6
|
|
7
|
+
## [0.3.1] - 2024-03-05
|
8
|
+
### Fixes
|
9
|
+
- Better support of errors
|
10
|
+
|
7
11
|
## [0.3.0] - 2023-11-15
|
8
12
|
### Changed
|
9
13
|
- Add support of the COGNITIVE_SUBSCRIPTION_REGION
|
data/Gemfile.lock
CHANGED
@@ -93,22 +93,19 @@ module TranslatorText
|
|
93
93
|
# If success, return the response body
|
94
94
|
# If failure, raise an error
|
95
95
|
def handle_response(response)
|
96
|
-
|
97
|
-
|
98
|
-
|
99
|
-
|
100
|
-
|
101
|
-
|
102
|
-
|
103
|
-
message: response['error']['message']
|
104
|
-
)
|
105
|
-
else
|
106
|
-
raise NetError.new(
|
107
|
-
code: response.code,
|
108
|
-
message: response.response.message
|
109
|
-
)
|
110
|
-
end
|
96
|
+
return response if response.code.between?(200, 299)
|
97
|
+
|
98
|
+
if response.request.format == :json && response['error']
|
99
|
+
raise ServiceError.new(
|
100
|
+
code: response['error']['code'],
|
101
|
+
message: response['error']['message']
|
102
|
+
)
|
111
103
|
end
|
104
|
+
|
105
|
+
raise NetError.new(
|
106
|
+
code: response.code,
|
107
|
+
message: response.response.message
|
108
|
+
)
|
112
109
|
end
|
113
110
|
|
114
111
|
def headers
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: translator-text
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.3.
|
4
|
+
version: 0.3.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Aymeric Brisse
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2024-03-05 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: dry-struct
|