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
,
nil
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.
- (Object, nil)
#code
def
code
()
-
>
Object
,
nil
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.
- (Object, nil)
#details
def
details
()
-
>
Object
,
nil
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.
- (Object, nil)
#domain
def
domain
()
-
>
Object
,
nil
Returns 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
,
nil
Returns the ::Google::Rpc::ErrorInfo
object present in the status_details
or details
array, given that the following is true:
- either
status_details
ordetails
exists and is an array - there is exactly one
::Google::Rpc::ErrorInfo
object in that array. Looks instatus_details
first, then indetails
.
- (::Google::Rpc::ErrorInfo, nil)
#error_metadata
def
error_metadata
()
-
>
Hash
,
nil
Returns 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
,
nil
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.
- (Object, nil)
#initialize
def
initialize
(
msg
=
nil
)
-
>
Error
Construct 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
,
nil
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.
- (Object, nil)
#reason
def
reason
()
-
>
Object
,
nil
Returns 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
,
nil
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.
- (Object, nil)
#status_details
def
status_details
()
-
>
Object
,
nil
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.
- (Object, nil)