google-cloud-speech 1.1.0 → 1.1.1

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 386e482dd167bd00b1bdf21ba06663d3ad97142d7a9982c2588bd5511865a571
4
- data.tar.gz: 8c432052d0acbcc7d062ca51f618bd4e91839c2745b5e95310ae792b3dc91d65
3
+ metadata.gz: 739b2fc36b5ef0e935a5aba33a9b9514f6c977f6612ad645bb10284ce6031144
4
+ data.tar.gz: 9aea715a82dec588f3c92bfd8cd372267caf77da276a138e06dcde9f7c046ed1
5
5
  SHA512:
6
- metadata.gz: fed8b322e431f842a7bcb3c377561d401d945ba6e925815a1f4f2e1844a52b703eea7397c01ea71f1a21e464c90ff786c17e65ae04e84f4dd85ef084f171ef2d
7
- data.tar.gz: c67d1bd0f64f72f61293a8047556735ab7131142e89ca7c9e2d9c414e9500e5a2462964d050ee2db70e7ccd3245c80dc15740c48b3f3606bbeaa1ede1491a098
6
+ metadata.gz: 5b7e8a0c5332a6a12cab3fcf5276d703b44369b8085cd4ee84fc31ce015b87e16534f25845e2062dd7ceb9d8759c7485d0b90aa915950140fc4bdd0a3969e7e0
7
+ data.tar.gz: deeb990df0900e437ec5bdaf59a4f76fd462cb9129a0830a5b7a6cbf94f805c21788770fa143e61ff50d05f231e9ba9bada466b10184dbdd536f33d357c94743
@@ -30,6 +30,10 @@ To summarize:
30
30
  current client retains this method, but simplifies the interface to match
31
31
  streaming methods in other Ruby clients. See
32
32
  [Streaming Interface](#streaming-interface) for more info.
33
+ * Previously, clients reported RPC errors by raising instances of
34
+ `Google::Gax::GaxError` and its subclasses. Now, RPC exceptions are of type
35
+ `Google::Cloud::Error` and its subclasses. See
36
+ [Handling Errors](#handling-errors) for more info.
33
37
  * Some classes have moved into different namespaces. See
34
38
  [Class Namespaces](#class-namespaces) for more info.
35
39
 
@@ -288,6 +292,62 @@ output_stream.each do |response|
288
292
  end
289
293
  ```
290
294
 
295
+ ### Handling Errors
296
+
297
+ The client reports standard
298
+ [gRPC error codes](https://github.com/grpc/grpc/blob/master/doc/statuscodes.md)
299
+ by raising exceptions. In older releases, these exceptions were located in the
300
+ `Google::Gax` namespace and were subclasses of the `Google::Gax::GaxError` base
301
+ exception class, defined in the `google-gax` gem. However, these classes were
302
+ different from the standard exceptions (subclasses of `Google::Cloud::Error`)
303
+ thrown by other client libraries such as `google-cloud-storage`.
304
+
305
+ The 1.0 client library now uses the `Google::Cloud::Error` exception hierarchy,
306
+ for consistency across all the Google Cloud client libraries. In general, these
307
+ exceptions have the same name as their counterparts from older releases, but
308
+ are located in the `Google::Cloud` namespace rather than the `Google::Gax`
309
+ namespace.
310
+
311
+ Old:
312
+ ```
313
+ client = Google::Cloud::Speech.new
314
+
315
+ config = {
316
+ language_code: "en-US",
317
+ sample_rate_hertz: 44_100,
318
+ encoding: :FLAC
319
+ }
320
+ audio = {
321
+ uri: "gs://cloud-samples-data/speech/brooklyn_bridge.flac"
322
+ }
323
+
324
+ begin
325
+ response = client.recognize config, audio
326
+ rescue Google::Gax::Error => e
327
+ # Handle exceptions that subclass Google::Gax::Error
328
+ end
329
+ ```
330
+
331
+ New:
332
+ ```
333
+ client = Google::Cloud::Speech.speech
334
+
335
+ config = {
336
+ language_code: "en-US",
337
+ sample_rate_hertz: 44_100,
338
+ encoding: :FLAC
339
+ }
340
+ audio = {
341
+ uri: "gs://cloud-samples-data/speech/brooklyn_bridge.flac"
342
+ }
343
+
344
+ begin
345
+ response = client.recognize config: config, audio: audio
346
+ rescue Google::Cloud::Error => e
347
+ # Handle exceptions that subclass Google::Cloud::Error
348
+ end
349
+ ```
350
+
291
351
  ### Class Namespaces
292
352
 
293
353
  In older releases, the client object was of classes with names like:
@@ -16,7 +16,7 @@
16
16
  module Google
17
17
  module Cloud
18
18
  module Speech
19
- VERSION = "1.1.0".freeze
19
+ VERSION = "1.1.1".freeze
20
20
  end
21
21
  end
22
22
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: google-cloud-speech
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.1.0
4
+ version: 1.1.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Google LLC
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2020-05-20 00:00:00.000000000 Z
11
+ date: 2020-05-26 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: google-cloud-core