Closed SteffenDE closed 1 year ago
The problem here is that we have a common error handling system for all services, even though they can all return different service-specific error info. We currently have a couple of special-case handlers, but really the handling should be delegated to the service that made the request in the first place.
What I'd like to do to resolve this is allow the service module to define a particular callback, and have the generic error handler look for that and call it if it exists (falling back to the existing defaults if it doesn't). I envisage this being done by adding an optional service_callback_module
field to the Operation
structs which is then checked by handle_aws_error
for the required callback (I say "optional" only so that it could be added a service at a time without breaking compatibility). That would also make it nicely extensible for any other service-specific post-request functionality we wanted to add down the road.
This feature is now available as of 2.4.0. See #902
So I'm currently experimenting with AWS Timestream. The ex_aws_timestream repo works fine, but when there is a
RejectedRecordsException
, there seems to be no way of getting the index of the failed record.This seems to be caused by this line https://github.com/ex-aws/ex_aws/blob/903eed1550949a0df43f025b126f19868218b22b/lib/ex_aws/request.ex#L152 that does not return any error details.
The plain response looks like this:
ex_aws only returns
{:error, {"RejectedRecordsException", "One or more records have been rejected. See RejectedRecords for details."}}
Environment
mix deps |grep ex_aws
: ex_aws 2.3.2mix deps | grep hackney
: hackney 1.18.1Current behavior
There is no way to get any error details.
Expected behavior
ex_aws should provide a way to access error details.