Reference documentation and code samples for the google-cloud-errors class Google::Cloud::Error.
Base google-cloud exception class.
Inherits
- StandardError
Methods
#body
def body() -> Object, nilReturns 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.
- (Object, nil)
#code
def code() -> Object, nilReturns 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.
- (Object, nil)
#details
def details() -> Object, nilReturns 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.
- (Object, nil)
#domain
def domain() -> Object, nilReturns the value of domain from the ::Google::Rpc::ErrorInfo
object, if it exists in the status_details array.
This is typically present on errors originating from calls to an API over gRPC.
- (Object, nil)
#error_info
def error_info() -> ::Google::Rpc::ErrorInfo, nilReturns the ::Google::Rpc::ErrorInfo object present in the status_details
or details array, given that the following is true:
- either
status_detailsordetailsexists and is an array - there is exactly one
::Google::Rpc::ErrorInfoobject in that array. Looks instatus_detailsfirst, then indetails.
- (::Google::Rpc::ErrorInfo, nil)
#error_metadata
def error_metadata() -> Hash, nilReturns the value of metadata from the ::Google::Rpc::ErrorInfo
object, if it exists in the status_details array.
This is typically present on errors originating from calls to an API over gRPC.
- (Hash, nil)
#header
def header() -> Object, nilReturns 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.
- (Object, nil)
#initialize
def initialize(msg = nil) -> ErrorConstruct a new Google::Cloud::Error object, optionally passing in a message.
- msg (String, nil) — an error message
- (Error) — a new instance of Error
#metadata
def metadata() -> Object, nilReturns 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.
- (Object, nil)
#reason
def reason() -> Object, nilReturns the value of reason from the ::Google::Rpc::ErrorInfo
object, if it exists in the status_details array.
This is typically present on errors originating from calls to an API over gRPC.
- (Object, nil)
#status_code
def status_code() -> Object, nilReturns 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.
- (Object, nil)
#status_details
def status_details() -> Object, nilReturns 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.
- (Object, nil)