gapic-common - Class Gapic::Rest::Error (v0.24.0)

Reference documentation and code samples for the gapic-common class Gapic::Rest::Error.

Gapic REST exception class

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

Parameter
  • err(Faraday::Error) — the Faraday error to wrap
Returns

#details

  def 
  
 details 
 () 
  
 - 
>  
 Object 
 , 
  
 nil 
 
Aliases
Returns
  • (Object, nil) — the details as parsed from the response body

#header

  def 
  
 header 
 () 
  
 - 
>  
 Object 
 , 
  
 nil 
 
Alias Of: #headers

The Cloud error wrapper expect to see a header property

Returns
  • (Object, nil) — the headers of the REST error

#headers

  def 
  
 headers 
 () 
  
 - 
>  
 Object 
 , 
  
 nil 
 
Aliases
Returns
  • (Object, nil) — the headers of the REST error

#initialize

  def 
  
 initialize 
 ( 
 message 
 , 
  
 status_code 
 , 
  
 status 
 : 
  
 nil 
 , 
  
 details 
 : 
  
 nil 
 , 
  
 headers 
 : 
  
 nil 
 ) 
  
 - 
>  
 Error 
 
Parameters
  • 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
Returns
  • ( Error ) — a new instance of Error

#status

  def 
  
 status 
 () 
  
 - 
>  
 Object 
 , 
  
 nil 
 
Returns
  • (Object, nil) — the text representation of status as parsed from the response body

#status_code

  def 
  
 status_code 
 () 
  
 - 
>  
 Integer 
 , 
  
 nil 
 
Returns
  • (Integer, nil) — the http status code for the error

#status_details

  def 
  
 status_details 
 () 
  
 - 
>  
 Object 
 , 
  
 nil 
 
Alias Of: #details

The Cloud error wrapper expect to see a status_details property

Returns
  • (Object, nil) — the details as parsed from the response body
Design a Mobile Site
View Site in Mobile | Classic
Share by: