Exception: Google::Cloud::Error
- Inherits:
-
StandardError
- Object
- StandardError
- Google::Cloud::Error
- Defined in:
- lib/google/cloud/errors.rb
Overview
Base google-cloud exception class.
Direct Known Subclasses
AbortedError, AlreadyExistsError, CanceledError, DataLossError, DeadlineExceededError, FailedPreconditionError, InternalError, InvalidArgumentError, NotFoundError, OutOfRangeError, PermissionDeniedError, ResourceExhaustedError, UnauthenticatedError, UnavailableError, UnimplementedError, UnknownError
Instance Method Summary collapse
-
#body ⇒ Object?
Returns the value of
bodyfrom the underlying cause error object, if both are present. -
#code ⇒ Object?
Returns the value of
codefrom the underlying cause error object, if both are present. -
#details ⇒ Object?
Returns the value of
detailsfrom the underlying cause error object, if both are present. -
#header ⇒ Object?
Returns the value of
headerfrom the underlying cause error object, if both are present. -
#initialize(msg = nil) ⇒ Error
constructor
Construct a new Google::Cloud::Error object, optionally passing in a message.
-
#metadata ⇒ Object?
Returns the value of
metadatafrom the underlying cause error object, if both are present. -
#status_code ⇒ Object?
Returns the value of
status_codefrom the underlying cause error object, if both are present. -
#status_details ⇒ Object?
Returns the value of
status_detailsfrom the underlying cause error object, if both are present.
Constructor Details
#initialize(msg = nil) ⇒ Error
Construct a new Google::Cloud::Error object, optionally passing in a message.
26 27 28 |
# File 'lib/google/cloud/errors.rb', line 26 def initialize msg = nil super end |
Instance Method Details
#body ⇒ Object?
Returns the value of body from the underlying cause error
object, if both are present. Otherwise returns nil.
This is typically present on errors originating from calls to an API over HTTP/REST.
51 52 53 54 |
# File 'lib/google/cloud/errors.rb', line 51 def body return nil unless cause&.respond_to? :body cause.body end |
#code ⇒ Object?
Returns the value of code from the underlying cause error
object, if both are present. Otherwise returns nil.
This is typically present on errors originating from calls to an API over gRPC.
77 78 79 80 |
# File 'lib/google/cloud/errors.rb', line 77 def code return nil unless cause&.respond_to? :code cause.code end |
#details ⇒ Object?
Returns the value of details from the underlying cause error
object, if both are present. Otherwise returns nil.
This is typically present on errors originating from calls to an API over gRPC.
90 91 92 93 |
# File 'lib/google/cloud/errors.rb', line 90 def details return nil unless cause&.respond_to? :details cause.details end |
#header ⇒ Object?
Returns the value of header from the underlying cause error
object, if both are present. Otherwise returns nil.
This is typically present on errors originating from calls to an API over HTTP/REST.
64 65 66 67 |
# File 'lib/google/cloud/errors.rb', line 64 def header return nil unless cause&.respond_to? :header cause.header end |
#metadata ⇒ Object?
Returns the value of metadata from the underlying cause error
object, if both are present. Otherwise returns nil.
This is typically present on errors originating from calls to an API over gRPC.
103 104 105 106 |
# File 'lib/google/cloud/errors.rb', line 103 def return nil unless cause&.respond_to? :metadata cause. end |
#status_code ⇒ Object?
Returns the value of status_code from the underlying cause error
object, if both are present. Otherwise returns nil.
This is typically present on errors originating from calls to an API over HTTP/REST.
38 39 40 41 |
# File 'lib/google/cloud/errors.rb', line 38 def status_code return nil unless cause&.respond_to? :status_code cause.status_code end |
#status_details ⇒ Object?
Returns the value of status_details from the underlying cause error
object, if both are present. Otherwise returns nil.
This is typically present on errors originating from calls to an API over gRPC.
116 117 118 119 |
# File 'lib/google/cloud/errors.rb', line 116 def status_details return nil unless cause&.respond_to? :status_details cause.status_details end |