Exception: Google::Gax::GaxError
- Inherits:
-
StandardError
- Object
- StandardError
- Google::Gax::GaxError
- Defined in:
- lib/google/gax/errors.rb
Overview
Common base class for exceptions raised by GAX.
Direct Known Subclasses
AbortedError, AlreadyExistsError, CanceledError, DataLossError, DeadlineExceededError, FailedPreconditionError, InternalError, InvalidArgumentError, NotFoundError, OutOfRangeError, PermissionDeniedError, ResourceExhaustedError, RetryError, UnauthenticatedError, UnavailableError, UnimplementedError, UnknownError
Instance Attribute Summary collapse
-
#status_details ⇒ Object
readonly
Returns the value of attribute status_details.
Instance Method Summary collapse
- #code ⇒ Object
- #details ⇒ Object
-
#initialize(msg) ⇒ GaxError
constructor
A new instance of GaxError.
- #metadata ⇒ Object
Constructor Details
#initialize(msg) ⇒ GaxError
Returns a new instance of GaxError.
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_details ⇒ Object (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
#code ⇒ Object
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 |
#details ⇒ Object
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 |
#metadata ⇒ Object
68 69 70 71 |
# File 'lib/google/gax/errors.rb', line 68 def return nil unless cause && cause.respond_to?(:metadata) cause. end |