Exception: Google::Gax::GaxError

Inherits:
StandardError
  • Object
show all
Defined in:
lib/google/gax/errors.rb

Overview

Common base class for exceptions raised by GAX.

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(msg) ⇒ GaxError

Returns a new instance of GaxError.

Parameters:

  • msg (String)

    describes the error that occurred.



41
42
43
44
45
46
47
48
# File 'lib/google/gax/errors.rb', line 41

def initialize(msg)
  msg = "GaxError #{msg}"
  msg += ", caused by #{$ERROR_INFO}" if $ERROR_INFO
  super(msg)
  @cause = $ERROR_INFO
  @status_details = \
    Google::Gax::Grpc.deserialize_error_status_details(@cause)
end

Instance Attribute Details

#status_detailsObject (readonly)

Returns the value of attribute status_details.



38
39
40
# File 'lib/google/gax/errors.rb', line 38

def status_details
  @status_details
end

Instance Method Details

#codeObject



58
59
60
61
# File 'lib/google/gax/errors.rb', line 58

def code
  return nil unless cause && cause.respond_to?(:code)
  cause.code
end

#detailsObject



63
64
65
66
# File 'lib/google/gax/errors.rb', line 63

def details
  return nil unless cause && cause.respond_to?(:details)
  cause.details
end

#metadataObject



68
69
70
71
# File 'lib/google/gax/errors.rb', line 68

def 
  return nil unless cause && cause.respond_to?(:metadata)
  cause.
end