Class List Method List File List

# Class: Com::Vmware::Vapi::Std::Errors::Error

Inherits:
  VAPI::Bindings::VapiError
  - Object
  - VAPI::Bindings::VapiError
  - Com::Vmware::Vapi::Std::Errors::Error
  show all
Defined in:
  /build/mts/release/bora-4571906/build/sdk/aggregated-bindings/ruby/com/vmware/vapi/std/errors.rb

## Overview

The ``Com::Vmware::Vapi::Std::Errors::Error`` error describes the fields common to all standard errors .

     This  error  serves two purposes:

      # It is the  error  that clients in many programming languages can catch to handle all standard  errors . Typically those clients will display one or more of the localizable messages from   :attr:`Com::Vmware::Vapi::Std::Errors::Error.messages`   to a human.
       # It is the  error  that  methods  can report when they need to report some  error , but the  error  doesn't fit into any other standard  error , and in fact the only reasonable way for a client to react to the  error  is to display the message(s) to a human.

## Direct Known Subclasses

AlreadyExists, AlreadyInDesiredState, Canceled, ConcurrentChange, FeatureInUse, InternalServerError, InvalidArgument, InvalidElementConfiguration, InvalidElementType, InvalidRequest, NotAllowedInCurrentState, NotFound, OperationNotFound, ResourceBusy, ResourceInUse, ResourceInaccessible, ServiceUnavailable, TimedOut, UnableToAllocateResource, Unauthenticated, Unauthorized, UnexpectedInput, Unsupported

## Instance Attribute Summary (collapse)

- - (VAPI::Bindings::VapiStruct?) data

  Data to facilitate clients responding to the method reporting a standard error to indicating that it was unable to complete successfully.

- - (Array<Com::Vmware::Vapi::Std::LocalizableMessage>) messages

  Stack of one or more localizable messages for human error consumers.

## Class Method Summary (collapse)

- + (VAPI::Bindings::ErrorType) binding_type

  Holds (gets or creates) the binding type metadata for this error type.

## Instance Method Summary (collapse)

- - (Error) initialize(binding_type = self.class.binding_type, error_value = nil) constructor

  Constructs a new instance.

## Constructor Details

### - (`Error`) initialize(binding_type = self.class.binding_type, error_value = nil)

Constructs a new instance.

Parameters:

- binding_type (`VAPI::Bindings::BindingType`) (defaults to: `self.class.binding_type`) —

  the specific BindingType declaration for this concrete VapiError type

- error_value (`VAPI::Data::ErrorValue`) (defaults to: `nil`) —

  the error value (default nil)

    181
    182
    183
    # File '/build/mts/release/bora-4571906/build/sdk/aggregated-bindings/ruby/com/vmware/vapi/std/errors.rb', line 181

    def initialize(binding_type=self.class.binding_type, error_value=nil)
        super(binding_type, error_value)
    end

## Instance Attribute Details

### - (`VAPI::Bindings::VapiStruct`?) data

Data to facilitate clients responding to the method reporting a standard error to indicating that it was unable to complete successfully.

      Methods  may provide data that clients can use when responding to  errors . Since the data that clients need may be specific to the context of the  method  reporting the  error , different  methods  that report the same  error  may provide different data in the  error . The documentation for each each  method  will describe what, if any, data it provides for each  error  it reports. The   :class:`Com::Vmware::Vapi::Std::Errors::ArgumentLocations`  ,   :class:`Com::Vmware::Vapi::Std::Errors::FileLocations`  , and   :class:`Com::Vmware::Vapi::Std::Errors::TransientIndication`    classes  are intended as possible values for this  field .   :class:`Com::Vmware::Vapi::Std::DynamicID`   may also be useful as a value for this  field  (although that is not its primary purpose). Some  classs  may provide their own specific  classes  for use as the value of this  field  when reporting  errors  from their  methods .

Some methods will not set this field when reporting errors .

Returns:

- (`VAPI::Bindings::VapiStruct`, `nil`)

    157
    158
    159
    160
    161
    162
    163
    164
    165
    166
    167
    168
    169
    170
    171
    172
    173
    174
    175
    176
    177
    178
    179
    180
    181
    182
    183
    184
    # File '/build/mts/release/bora-4571906/build/sdk/aggregated-bindings/ruby/com/vmware/vapi/std/errors.rb', line 157

    class Error < VAPI::Bindings::VapiError

        class << self
            # Holds (gets or creates) the binding type metadata for this error type.
            # @scope class
            # @return [VAPI::Bindings::ErrorType] the binding type
            def binding_type
                @binding_type ||= VAPI::Bindings::ErrorType.new(
                    'com.vmware.vapi.std.errors.error',
                    {
                        'messages' => VAPI::Bindings::ListType.new(VAPI::Bindings::ReferenceType.new('Com::Vmware::Vapi::Std::LocalizableMessage')),
                        'data' => VAPI::Bindings::OptionalType.new(VAPI::Bindings::DynamicStructType.new()),
                    },
                    Error)
            end
        end

        attr_accessor :messages,
          :data

        # Constructs a new instance.
        # @param binding_type [VAPI::Bindings::BindingType] the specific BindingType
        #        declaration for this concrete VapiError type
        # @param error_value [VAPI::Data::ErrorValue] the error value (default nil)
        def initialize(binding_type=self.class.binding_type, error_value=nil)
            super(binding_type, error_value)
        end
    end

### - (`Array<Com::Vmware::Vapi::Std::LocalizableMessage>`) messages

Stack of one or more localizable messages for human error consumers.

     The message at the top of the stack (first in the list) describes the  error  from the perspective of the  method  the client invoked. Each subsequent message in the stack describes the "cause" of the prior message.

Returns:

- (`Array<Com::Vmware::Vapi::Std::LocalizableMessage>`)

    157
    158
    159
    160
    161
    162
    163
    164
    165
    166
    167
    168
    169
    170
    171
    172
    173
    174
    175
    176
    177
    178
    179
    180
    181
    182
    183
    184
    # File '/build/mts/release/bora-4571906/build/sdk/aggregated-bindings/ruby/com/vmware/vapi/std/errors.rb', line 157

    class Error < VAPI::Bindings::VapiError

        class << self
            # Holds (gets or creates) the binding type metadata for this error type.
            # @scope class
            # @return [VAPI::Bindings::ErrorType] the binding type
            def binding_type
                @binding_type ||= VAPI::Bindings::ErrorType.new(
                    'com.vmware.vapi.std.errors.error',
                    {
                        'messages' => VAPI::Bindings::ListType.new(VAPI::Bindings::ReferenceType.new('Com::Vmware::Vapi::Std::LocalizableMessage')),
                        'data' => VAPI::Bindings::OptionalType.new(VAPI::Bindings::DynamicStructType.new()),
                    },
                    Error)
            end
        end

        attr_accessor :messages,
          :data

        # Constructs a new instance.
        # @param binding_type [VAPI::Bindings::BindingType] the specific BindingType
        #        declaration for this concrete VapiError type
        # @param error_value [VAPI::Data::ErrorValue] the error value (default nil)
        def initialize(binding_type=self.class.binding_type, error_value=nil)
            super(binding_type, error_value)
        end
    end

## Class Method Details

### + (`VAPI::Bindings::ErrorType`) binding_type

Holds (gets or creates) the binding type metadata for this error type.

Returns:

- (`VAPI::Bindings::ErrorType`) —

  the binding type

    163
    164
    165
    166
    167
    168
    169
    170
    171
    # File '/build/mts/release/bora-4571906/build/sdk/aggregated-bindings/ruby/com/vmware/vapi/std/errors.rb', line 163

    def binding_type
        @binding_type ||= VAPI::Bindings::ErrorType.new(
            'com.vmware.vapi.std.errors.error',
            {
                'messages' => VAPI::Bindings::ListType.new(VAPI::Bindings::ReferenceType.new('Com::Vmware::Vapi::Std::LocalizableMessage')),
                'data' => VAPI::Bindings::OptionalType.new(VAPI::Bindings::DynamicStructType.new()),
            },
            Error)
    end