Reference documentation and code samples for the gapic-common class Gapic::Rest::Error.
Gapic REST exception class
Inherits
Methods
.wrap_faraday_error
def
self
.
wrap_faraday_error
(
err
)
-
>
Gapic
::
Rest
::
Error
This creates a new error message wrapping the Faraday's one. Additionally it tries to parse and set a detailed message and an error code from from the Google Cloud's response body
- err(Faraday::Error) — the Faraday error to wrap
#details
def
details
()
-
>
Object
,
nil
- (Object, nil) — the details as parsed from the response body
#header
def
header
()
-
>
Object
,
nil
The Cloud error wrapper expect to see a header
property
- (Object, nil) — the headers of the REST error
#headers
def
headers
()
-
>
Object
,
nil
- (Object, nil) — the headers of the REST error
#initialize
def
initialize
(
message
,
status_code
,
status
:
nil
,
details
:
nil
,
headers
:
nil
)
-
>
Error
- message(String, nil) — error message
- status_code(Integer, nil) — HTTP status code of this error
- status(String, nil) (defaults to: nil) — The text representation of status as parsed from the response body
- details(Object, nil) (defaults to: nil) — Details data of this error
- headers(Object, nil) (defaults to: nil) — Http headers data of this error
- ( Error ) — a new instance of Error
#status
def
status
()
-
>
Object
,
nil
- (Object, nil) — the text representation of status as parsed from the response body
#status_code
def
status_code
()
-
>
Integer
,
nil
- (Integer, nil) — the http status code for the error
#status_details
def
status_details
()
-
>
Object
,
nil
The Cloud error wrapper expect to see a status_details
property
- (Object, nil) — the details as parsed from the response body