google-cloud-errors 1.3.0 → 1.4.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/README.md +1 -3
- data/lib/google/cloud/errors/version.rb +1 -1
- data/lib/google/cloud/errors.rb +113 -1
- metadata +5 -145
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 22c1d90c0cd381a6054397d657b8c1a51e5e52630ee63a2c0d3361113a657243
|
4
|
+
data.tar.gz: 28668e7bafa0251bdb826b04c552da45745fa67aa9921fbf7d7ab79ca5e07d92
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 88d79f7228e471c6a9127358b0132263523506332312609ae384887701589f8a44c1cdd5966582b8a689255ecc83736e9eba42e5f120db84af823d2271d6a435
|
7
|
+
data.tar.gz: '08b8e749195cf7e2adc5b57669d1ec14bc12c6c4e25fcab29677a509b7853396b7f9fcca9e4b504440b6a42f80d6d664b5131fd9a5cf7fdba681e96de04550e7'
|
data/README.md
CHANGED
@@ -47,6 +47,4 @@ This library is licensed under Apache 2.0. Full license text is available in
|
|
47
47
|
|
48
48
|
Please report bugs
|
49
49
|
[on Github](https://github.com/googleapis/google-cloud-ruby/issues).
|
50
|
-
|
51
|
-
[ask questions](http://stackoverflow.com/questions/tagged/google-cloud-platform+ruby)
|
52
|
-
about the client or APIs on [StackOverflow](http://stackoverflow.com).
|
50
|
+
You can also ask questions about the client or APIs on StackOverflow.
|
data/lib/google/cloud/errors.rb
CHANGED
@@ -132,7 +132,7 @@ module Google
|
|
132
132
|
@error_info ||= begin
|
133
133
|
check_property = lambda do |prop|
|
134
134
|
if prop.is_a? Array
|
135
|
-
error_infos = prop.find_all { |status| status.is_a?
|
135
|
+
error_infos = prop.find_all { |status| status.is_a? ::Google::Rpc::ErrorInfo }
|
136
136
|
if error_infos.length == 1
|
137
137
|
error_infos[0]
|
138
138
|
end
|
@@ -231,6 +231,13 @@ module Google
|
|
231
231
|
##
|
232
232
|
# Canceled indicates the operation was cancelled (typically by the caller).
|
233
233
|
class CanceledError < Error
|
234
|
+
##
|
235
|
+
# gRPC error code for CANCELLED
|
236
|
+
#
|
237
|
+
# @return [Integer]
|
238
|
+
def code
|
239
|
+
1
|
240
|
+
end
|
234
241
|
end
|
235
242
|
|
236
243
|
##
|
@@ -240,6 +247,13 @@ module Google
|
|
240
247
|
# errors raised by APIs that do not return enough error information
|
241
248
|
# may be converted to this error.
|
242
249
|
class UnknownError < Error
|
250
|
+
##
|
251
|
+
# gRPC error code for UNKNOWN
|
252
|
+
#
|
253
|
+
# @return [Integer]
|
254
|
+
def code
|
255
|
+
2
|
256
|
+
end
|
243
257
|
end
|
244
258
|
|
245
259
|
##
|
@@ -248,6 +262,13 @@ module Google
|
|
248
262
|
# that are problematic regardless of the state of the system
|
249
263
|
# (e.g., a malformed file name).
|
250
264
|
class InvalidArgumentError < Error
|
265
|
+
##
|
266
|
+
# gRPC error code for INVALID_ARGUMENT
|
267
|
+
#
|
268
|
+
# @return [Integer]
|
269
|
+
def code
|
270
|
+
3
|
271
|
+
end
|
251
272
|
end
|
252
273
|
|
253
274
|
##
|
@@ -257,18 +278,39 @@ module Google
|
|
257
278
|
# example, a successful response from a server could have been delayed
|
258
279
|
# long enough for the deadline to expire.
|
259
280
|
class DeadlineExceededError < Error
|
281
|
+
##
|
282
|
+
# gRPC error code for DEADLINE_EXCEEDED
|
283
|
+
#
|
284
|
+
# @return [Integer]
|
285
|
+
def code
|
286
|
+
4
|
287
|
+
end
|
260
288
|
end
|
261
289
|
|
262
290
|
##
|
263
291
|
# NotFound means some requested entity (e.g., file or directory) was
|
264
292
|
# not found.
|
265
293
|
class NotFoundError < Error
|
294
|
+
##
|
295
|
+
# gRPC error code for NOT_FOUND
|
296
|
+
#
|
297
|
+
# @return [Integer]
|
298
|
+
def code
|
299
|
+
5
|
300
|
+
end
|
266
301
|
end
|
267
302
|
|
268
303
|
##
|
269
304
|
# AlreadyExists means an attempt to create an entity failed because one
|
270
305
|
# already exists.
|
271
306
|
class AlreadyExistsError < Error
|
307
|
+
##
|
308
|
+
# gRPC error code for ALREADY_EXISTS
|
309
|
+
#
|
310
|
+
# @return [Integer]
|
311
|
+
def code
|
312
|
+
6
|
313
|
+
end
|
272
314
|
end
|
273
315
|
|
274
316
|
##
|
@@ -279,12 +321,26 @@ module Google
|
|
279
321
|
# used if the caller cannot be identified (use Unauthenticated
|
280
322
|
# instead for those errors).
|
281
323
|
class PermissionDeniedError < Error
|
324
|
+
##
|
325
|
+
# gRPC error code for PERMISSION_DENIED
|
326
|
+
#
|
327
|
+
# @return [Integer]
|
328
|
+
def code
|
329
|
+
7
|
330
|
+
end
|
282
331
|
end
|
283
332
|
|
284
333
|
##
|
285
334
|
# ResourceExhausted indicates some resource has been exhausted, perhaps
|
286
335
|
# a per-user quota, or perhaps the entire file system is out of space.
|
287
336
|
class ResourceExhaustedError < Error
|
337
|
+
##
|
338
|
+
# gRPC error code for RESOURCE_EXHAUSTED
|
339
|
+
#
|
340
|
+
# @return [Integer]
|
341
|
+
def code
|
342
|
+
8
|
343
|
+
end
|
288
344
|
end
|
289
345
|
|
290
346
|
##
|
@@ -308,6 +364,13 @@ module Google
|
|
308
364
|
# server does not match the condition. E.g., conflicting
|
309
365
|
# read-modify-write on the same resource.
|
310
366
|
class FailedPreconditionError < Error
|
367
|
+
##
|
368
|
+
# gRPC error code for FAILED_PRECONDITION
|
369
|
+
#
|
370
|
+
# @return [Integer]
|
371
|
+
def code
|
372
|
+
9
|
373
|
+
end
|
311
374
|
end
|
312
375
|
|
313
376
|
##
|
@@ -318,6 +381,13 @@ module Google
|
|
318
381
|
# See litmus test above for deciding between FailedPrecondition,
|
319
382
|
# Aborted, and Unavailable.
|
320
383
|
class AbortedError < Error
|
384
|
+
##
|
385
|
+
# gRPC error code for ABORTED
|
386
|
+
#
|
387
|
+
# @return [Integer]
|
388
|
+
def code
|
389
|
+
10
|
390
|
+
end
|
321
391
|
end
|
322
392
|
|
323
393
|
##
|
@@ -337,12 +407,26 @@ module Google
|
|
337
407
|
# a space can easily look for an OutOfRange error to detect when
|
338
408
|
# they are done.
|
339
409
|
class OutOfRangeError < Error
|
410
|
+
##
|
411
|
+
# gRPC error code for OUT_OF_RANGE
|
412
|
+
#
|
413
|
+
# @return [Integer]
|
414
|
+
def code
|
415
|
+
11
|
416
|
+
end
|
340
417
|
end
|
341
418
|
|
342
419
|
##
|
343
420
|
# Unimplemented indicates operation is not implemented or not
|
344
421
|
# supported/enabled in this service.
|
345
422
|
class UnimplementedError < Error
|
423
|
+
##
|
424
|
+
# gRPC error code for UNIMPLEMENTED
|
425
|
+
#
|
426
|
+
# @return [Integer]
|
427
|
+
def code
|
428
|
+
12
|
429
|
+
end
|
346
430
|
end
|
347
431
|
|
348
432
|
##
|
@@ -350,6 +434,13 @@ module Google
|
|
350
434
|
# system has been broken. If you see one of these errors,
|
351
435
|
# something is very broken.
|
352
436
|
class InternalError < Error
|
437
|
+
##
|
438
|
+
# gRPC error code for INTERNAL
|
439
|
+
#
|
440
|
+
# @return [Integer]
|
441
|
+
def code
|
442
|
+
13
|
443
|
+
end
|
353
444
|
end
|
354
445
|
|
355
446
|
##
|
@@ -360,17 +451,38 @@ module Google
|
|
360
451
|
# See litmus test above for deciding between FailedPrecondition,
|
361
452
|
# Aborted, and Unavailable.
|
362
453
|
class UnavailableError < Error
|
454
|
+
##
|
455
|
+
# gRPC error code for UNAVAILABLE
|
456
|
+
#
|
457
|
+
# @return [Integer]
|
458
|
+
def code
|
459
|
+
14
|
460
|
+
end
|
363
461
|
end
|
364
462
|
|
365
463
|
##
|
366
464
|
# DataLoss indicates unrecoverable data loss or corruption.
|
367
465
|
class DataLossError < Error
|
466
|
+
##
|
467
|
+
# gRPC error code for DATA_LOSS
|
468
|
+
#
|
469
|
+
# @return [Integer]
|
470
|
+
def code
|
471
|
+
15
|
472
|
+
end
|
368
473
|
end
|
369
474
|
|
370
475
|
##
|
371
476
|
# Unauthenticated indicates the request does not have valid
|
372
477
|
# authentication credentials for the operation.
|
373
478
|
class UnauthenticatedError < Error
|
479
|
+
##
|
480
|
+
# gRPC error code for UNAUTHENTICATED
|
481
|
+
#
|
482
|
+
# @return [Integer]
|
483
|
+
def code
|
484
|
+
16
|
485
|
+
end
|
374
486
|
end
|
375
487
|
end
|
376
488
|
end
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: google-cloud-errors
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.
|
4
|
+
version: 1.4.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Mike Moore
|
@@ -9,148 +9,8 @@ authors:
|
|
9
9
|
autorequire:
|
10
10
|
bindir: bin
|
11
11
|
cert_chain: []
|
12
|
-
date:
|
13
|
-
dependencies:
|
14
|
-
- !ruby/object:Gem::Dependency
|
15
|
-
name: autotest-suffix
|
16
|
-
requirement: !ruby/object:Gem::Requirement
|
17
|
-
requirements:
|
18
|
-
- - "~>"
|
19
|
-
- !ruby/object:Gem::Version
|
20
|
-
version: '1.1'
|
21
|
-
type: :development
|
22
|
-
prerelease: false
|
23
|
-
version_requirements: !ruby/object:Gem::Requirement
|
24
|
-
requirements:
|
25
|
-
- - "~>"
|
26
|
-
- !ruby/object:Gem::Version
|
27
|
-
version: '1.1'
|
28
|
-
- !ruby/object:Gem::Dependency
|
29
|
-
name: google-style
|
30
|
-
requirement: !ruby/object:Gem::Requirement
|
31
|
-
requirements:
|
32
|
-
- - "~>"
|
33
|
-
- !ruby/object:Gem::Version
|
34
|
-
version: 1.25.1
|
35
|
-
type: :development
|
36
|
-
prerelease: false
|
37
|
-
version_requirements: !ruby/object:Gem::Requirement
|
38
|
-
requirements:
|
39
|
-
- - "~>"
|
40
|
-
- !ruby/object:Gem::Version
|
41
|
-
version: 1.25.1
|
42
|
-
- !ruby/object:Gem::Dependency
|
43
|
-
name: minitest
|
44
|
-
requirement: !ruby/object:Gem::Requirement
|
45
|
-
requirements:
|
46
|
-
- - "~>"
|
47
|
-
- !ruby/object:Gem::Version
|
48
|
-
version: '5.14'
|
49
|
-
type: :development
|
50
|
-
prerelease: false
|
51
|
-
version_requirements: !ruby/object:Gem::Requirement
|
52
|
-
requirements:
|
53
|
-
- - "~>"
|
54
|
-
- !ruby/object:Gem::Version
|
55
|
-
version: '5.14'
|
56
|
-
- !ruby/object:Gem::Dependency
|
57
|
-
name: minitest-autotest
|
58
|
-
requirement: !ruby/object:Gem::Requirement
|
59
|
-
requirements:
|
60
|
-
- - "~>"
|
61
|
-
- !ruby/object:Gem::Version
|
62
|
-
version: '1.0'
|
63
|
-
type: :development
|
64
|
-
prerelease: false
|
65
|
-
version_requirements: !ruby/object:Gem::Requirement
|
66
|
-
requirements:
|
67
|
-
- - "~>"
|
68
|
-
- !ruby/object:Gem::Version
|
69
|
-
version: '1.0'
|
70
|
-
- !ruby/object:Gem::Dependency
|
71
|
-
name: minitest-focus
|
72
|
-
requirement: !ruby/object:Gem::Requirement
|
73
|
-
requirements:
|
74
|
-
- - "~>"
|
75
|
-
- !ruby/object:Gem::Version
|
76
|
-
version: '1.1'
|
77
|
-
type: :development
|
78
|
-
prerelease: false
|
79
|
-
version_requirements: !ruby/object:Gem::Requirement
|
80
|
-
requirements:
|
81
|
-
- - "~>"
|
82
|
-
- !ruby/object:Gem::Version
|
83
|
-
version: '1.1'
|
84
|
-
- !ruby/object:Gem::Dependency
|
85
|
-
name: minitest-rg
|
86
|
-
requirement: !ruby/object:Gem::Requirement
|
87
|
-
requirements:
|
88
|
-
- - "~>"
|
89
|
-
- !ruby/object:Gem::Version
|
90
|
-
version: '5.2'
|
91
|
-
type: :development
|
92
|
-
prerelease: false
|
93
|
-
version_requirements: !ruby/object:Gem::Requirement
|
94
|
-
requirements:
|
95
|
-
- - "~>"
|
96
|
-
- !ruby/object:Gem::Version
|
97
|
-
version: '5.2'
|
98
|
-
- !ruby/object:Gem::Dependency
|
99
|
-
name: redcarpet
|
100
|
-
requirement: !ruby/object:Gem::Requirement
|
101
|
-
requirements:
|
102
|
-
- - "~>"
|
103
|
-
- !ruby/object:Gem::Version
|
104
|
-
version: '3.0'
|
105
|
-
type: :development
|
106
|
-
prerelease: false
|
107
|
-
version_requirements: !ruby/object:Gem::Requirement
|
108
|
-
requirements:
|
109
|
-
- - "~>"
|
110
|
-
- !ruby/object:Gem::Version
|
111
|
-
version: '3.0'
|
112
|
-
- !ruby/object:Gem::Dependency
|
113
|
-
name: simplecov
|
114
|
-
requirement: !ruby/object:Gem::Requirement
|
115
|
-
requirements:
|
116
|
-
- - "~>"
|
117
|
-
- !ruby/object:Gem::Version
|
118
|
-
version: '0.9'
|
119
|
-
type: :development
|
120
|
-
prerelease: false
|
121
|
-
version_requirements: !ruby/object:Gem::Requirement
|
122
|
-
requirements:
|
123
|
-
- - "~>"
|
124
|
-
- !ruby/object:Gem::Version
|
125
|
-
version: '0.9'
|
126
|
-
- !ruby/object:Gem::Dependency
|
127
|
-
name: yard
|
128
|
-
requirement: !ruby/object:Gem::Requirement
|
129
|
-
requirements:
|
130
|
-
- - "~>"
|
131
|
-
- !ruby/object:Gem::Version
|
132
|
-
version: '0.9'
|
133
|
-
type: :development
|
134
|
-
prerelease: false
|
135
|
-
version_requirements: !ruby/object:Gem::Requirement
|
136
|
-
requirements:
|
137
|
-
- - "~>"
|
138
|
-
- !ruby/object:Gem::Version
|
139
|
-
version: '0.9'
|
140
|
-
- !ruby/object:Gem::Dependency
|
141
|
-
name: yard-doctest
|
142
|
-
requirement: !ruby/object:Gem::Requirement
|
143
|
-
requirements:
|
144
|
-
- - "~>"
|
145
|
-
- !ruby/object:Gem::Version
|
146
|
-
version: 0.1.13
|
147
|
-
type: :development
|
148
|
-
prerelease: false
|
149
|
-
version_requirements: !ruby/object:Gem::Requirement
|
150
|
-
requirements:
|
151
|
-
- - "~>"
|
152
|
-
- !ruby/object:Gem::Version
|
153
|
-
version: 0.1.13
|
12
|
+
date: 2024-03-07 00:00:00.000000000 Z
|
13
|
+
dependencies: []
|
154
14
|
description: google-cloud-errors defines error classes for google-cloud-ruby.
|
155
15
|
email:
|
156
16
|
- mike@blowmage.com
|
@@ -179,14 +39,14 @@ required_ruby_version: !ruby/object:Gem::Requirement
|
|
179
39
|
requirements:
|
180
40
|
- - ">="
|
181
41
|
- !ruby/object:Gem::Version
|
182
|
-
version: '2.
|
42
|
+
version: '2.7'
|
183
43
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
184
44
|
requirements:
|
185
45
|
- - ">="
|
186
46
|
- !ruby/object:Gem::Version
|
187
47
|
version: '0'
|
188
48
|
requirements: []
|
189
|
-
rubygems_version: 3.
|
49
|
+
rubygems_version: 3.5.6
|
190
50
|
signing_key:
|
191
51
|
specification_version: 4
|
192
52
|
summary: Error classes for google-cloud-ruby
|