Exception: Evernote::EDAM::Error::EDAMUserException
- Inherits:
-
Thrift::Exception
- Object
- StandardError
- Thrift::Exception
- Evernote::EDAM::Error::EDAMUserException
- Includes:
- Thrift::Struct, Thrift::Struct_Union
- Defined in:
- lib/Evernote/EDAM/errors_types.rb
Overview
a problem that a caller may be able to resolve. For example, if the user attempts to add a note to their account which would exceed their storage quota, this type of exception may be thrown to indicate the source of the error so that they can choose an alternate action.
This exception would not be used for internal system errors that do not reflect user actions, but rather reflect a problem within the service that the user cannot resolve.
errorCode: The numeric code indicating the type of error that occurred.
must be one of the values of EDAMErrorCode.
parameter: If the error applied to a particular input parameter, this will
indicate which parameter.
Constant Summary collapse
- ERRORCODE =
1
- PARAMETER =
2
- FIELDS =
{ ERRORCODE => {:type => ::Thrift::Types::I32, :name => 'errorCode', :enum_class => ::Evernote::EDAM::Error::EDAMErrorCode}, PARAMETER => {:type => ::Thrift::Types::STRING, :name => 'parameter', :optional => true} }
Constants included from Thrift::Struct_Union
Thrift::Struct_Union::CONTAINER_TYPES
Instance Attribute Summary
Attributes inherited from Thrift::Exception
Instance Method Summary collapse
Methods included from Thrift::Struct
#<=>, #==, #differences, #eql?, field_accessor, #fields_with_default_values, generate_accessors, #hash, #initialize, #inspect, qmark_isset_method, #read, #write
Methods included from Thrift::Struct_Union
#each_field, #field_info, #inspect_collection, #inspect_field, #is_container?, #name_to_id, #read_field, #sorted_field_ids, #write_container, #write_data
Methods inherited from Thrift::Exception
Instance Method Details
#struct_fields ⇒ Object
61 |
# File 'lib/Evernote/EDAM/errors_types.rb', line 61 def struct_fields; FIELDS; end |
#validate ⇒ Object
63 64 65 66 67 68 |
# File 'lib/Evernote/EDAM/errors_types.rb', line 63 def validate raise ::Thrift::ProtocolException.new(::Thrift::ProtocolException::UNKNOWN, 'Required field errorCode is unset!') unless @errorCode unless @errorCode.nil? || ::Evernote::EDAM::Error::EDAMErrorCode::VALID_VALUES.include?(@errorCode) raise ::Thrift::ProtocolException.new(::Thrift::ProtocolException::UNKNOWN, 'Invalid value of field errorCode!') end end |