Skip to content

x-amz-json-1.0 not properly serializing error responses #903

@btalbot

Description

@btalbot

The errors from ElasticMQ (1.5.1) when using the application/x-amz-json-1.0 content-type are incomplete. The errors returned seem to resolve to just Sender which is not really helpful and cause the AWS SDK (the ruby version at least) to always result in an undocumented exception like Aws::SQS::Errors::Sender to be raised instead of the documented errors.

According to the smithy.io specs (best docs for the protocol I can find) the response body __type is expected to contain the name of the error shape.

https://smithy.io/1.0/spec/aws/aws-json-1_0-protocol.html#operation-error-serialization

The response body from real SQS when attempting to delete a non-existent queue with the x-amz-json-1.0 content-type is

{"__type":"com.amazonaws.sqs#QueueDoesNotExist","message":"The specified queue does not exist."}

while the response body from ElasticMQ 1.5.1 is

{"Message":"AWS.SimpleQueueService.NonExistentQueue; see the SQS docs.","__type":"Sender"}

The smithy.io docs do add more details including options to carry error details in a response header and I do not know which is the proper solution. I've also not attempted to use updated protocols like x-amz-json-1.1.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions