You are viewing documentation for version 2 of the AWS SDK for Ruby. Version 3 documentation can be found here.

Exception: Aws::Errors::ServiceError

Inherits:
RuntimeError
  • Object
show all
Defined in:
aws-sdk-core/lib/aws-sdk-core/errors.rb

Overview

The base class for all errors returned by an Amazon Web Service. All ~400 level client errors and ~500 level server errors are raised as service errors. This indicates it was an error returned from the service and not one generated by the client.

Direct Known Subclasses

ACM::Errors::ServiceError, APIGateway::Errors::ServiceError, AppStream::Errors::ServiceError, ApplicationAutoScaling::Errors::ServiceError, ApplicationDiscoveryService::Errors::ServiceError, Athena::Errors::ServiceError, AutoScaling::Errors::ServiceError, Batch::Errors::ServiceError, Budgets::Errors::ServiceError, CloudDirectory::Errors::ServiceError, CloudFormation::Errors::ServiceError, CloudFront::Errors::ServiceError, CloudHSM::Errors::ServiceError, CloudHSMV2::Errors::ServiceError, CloudSearch::Errors::ServiceError, CloudSearchDomain::Errors::ServiceError, CloudTrail::Errors::ServiceError, CloudWatch::Errors::ServiceError, CloudWatchEvents::Errors::ServiceError, CloudWatchLogs::Errors::ServiceError, CodeBuild::Errors::ServiceError, CodeCommit::Errors::ServiceError, CodeDeploy::Errors::ServiceError, CodePipeline::Errors::ServiceError, CodeStar::Errors::ServiceError, CognitoIdentity::Errors::ServiceError, CognitoIdentityProvider::Errors::ServiceError, CognitoSync::Errors::ServiceError, ConfigService::Errors::ServiceError, CostandUsageReportService::Errors::ServiceError, DAX::Errors::ServiceError, DataPipeline::Errors::ServiceError, DatabaseMigrationService::Errors::ServiceError, DeviceFarm::Errors::ServiceError, DirectConnect::Errors::ServiceError, DirectoryService::Errors::ServiceError, DynamoDB::Errors::ServiceError, DynamoDBStreams::Errors::ServiceError, Aws::EC2::Errors::ServiceError, Aws::ECR::Errors::ServiceError, Aws::ECS::Errors::ServiceError, Aws::EFS::Errors::ServiceError, Aws::EMR::Errors::ServiceError, Aws::ElastiCache::Errors::ServiceError, Aws::ElasticBeanstalk::Errors::ServiceError, Aws::ElasticLoadBalancing::Errors::ServiceError, Aws::ElasticLoadBalancingV2::Errors::ServiceError, Aws::ElasticTranscoder::Errors::ServiceError, Aws::ElasticsearchService::Errors::ServiceError, Firehose::Errors::ServiceError, GameLift::Errors::ServiceError, Glacier::Errors::ServiceError, Glue::Errors::ServiceError, Greengrass::Errors::ServiceError, Health::Errors::ServiceError, IAM::Errors::ServiceError, ImportExport::Errors::ServiceError, Inspector::Errors::ServiceError, IoT::Errors::ServiceError, IoTDataPlane::Errors::ServiceError, KMS::Errors::ServiceError, Kinesis::Errors::ServiceError, KinesisAnalytics::Errors::ServiceError, Lambda::Errors::ServiceError, LambdaPreview::Errors::ServiceError, Lex::Errors::ServiceError, LexModelBuildingService::Errors::ServiceError, Lightsail::Errors::ServiceError, MTurk::Errors::ServiceError, MachineLearning::Errors::ServiceError, MarketplaceCommerceAnalytics::Errors::ServiceError, MarketplaceEntitlementService::Errors::ServiceError, MarketplaceMetering::Errors::ServiceError, MigrationHub::Errors::ServiceError, Mobile::Errors::ServiceError, OpsWorks::Errors::ServiceError, OpsWorksCM::Errors::ServiceError, Organizations::Errors::ServiceError, Pinpoint::Errors::ServiceError, Polly::Errors::ServiceError, RDS::Errors::ServiceError, Redshift::Errors::ServiceError, Rekognition::Errors::ServiceError, ResourceGroupsTaggingAPI::Errors::ServiceError, Route53::Errors::ServiceError, Route53Domains::Errors::ServiceError, S3::Errors::ServiceError, SES::Errors::ServiceError, SMS::Errors::ServiceError, SNS::Errors::ServiceError, SQS::Errors::ServiceError, SSM::Errors::ServiceError, STS::Errors::ServiceError, SWF::Errors::ServiceError, ServiceCatalog::Errors::ServiceError, Shield::Errors::ServiceError, SimpleDB::Errors::ServiceError, Snowball::Errors::ServiceError, States::Errors::ServiceError, StorageGateway::Errors::ServiceError, Support::Errors::ServiceError, WAF::Errors::ServiceError, WAFRegional::Errors::ServiceError, WorkDocs::Errors::ServiceError, WorkSpaces::Errors::ServiceError, XRay::Errors::ServiceError

Class Attribute Summary collapse

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(context, message) ⇒ ServiceError

Returns a new instance of ServiceError

Parameters:



16
17
18
19
20
# File 'aws-sdk-core/lib/aws-sdk-core/errors.rb', line 16

def initialize(context, message)
  @code = self.class.code
  @context = context
  super(message)
end

Class Attribute Details

.codeString

Returns:

  • (String)


32
33
34
# File 'aws-sdk-core/lib/aws-sdk-core/errors.rb', line 32

def code
  @code
end

Instance Attribute Details

#codeString (readonly)

Returns:

  • (String)


23
24
25
# File 'aws-sdk-core/lib/aws-sdk-core/errors.rb', line 23

def code
  @code
end

#contextSeahorse::Client::RequestContext (readonly)

Returns The context of the request that triggered the remote service to return this error.

Returns:



27
28
29
# File 'aws-sdk-core/lib/aws-sdk-core/errors.rb', line 27

def context
  @context
end