aws / aws-sdk-net

The official AWS SDK for .NET. For more information on the AWS SDK for .NET, see our web site:
http://aws.amazon.com/sdkfornet/
Apache License 2.0
2.07k stars 862 forks source link

SendEmailAsync does not document AmazonSimpleEmailServiceV2Exception #3550

Open lonix1 opened 13 hours ago

lonix1 commented 13 hours ago

Describe the issue

I'm using SES v2.

I used SendEmailAsync with an identity that has a default configuration set. The policy was not correct and so prevented my app from sending the mail:

This exception was thrown: AmazonSimpleEmailServiceV2Exception:

Amazon.SimpleEmailV2.AmazonSimpleEmailServiceV2Exception: User 'arn:aws:iam::000000000000:user/foo' is not authorized to perform 'ses:SendEmail' on resource `arn:aws:ses:region:000000000000:configuration-set/bar'

That exception is not documented - neither in the API docs nor in the doc-comments that show in my IDE.

Links

https://docs.aws.amazon.com/sdkfornet/v3/apidocs/items/SimpleEmailV2/MSimpleEmailServiceV2SendEmailAsyncSendEmailRequestCancellationToken.html

lonix1 commented 13 hours ago

Also, that is probably not the right exception to throw in the case of a misconfiguration. A misconfigured app could send 1000s of emails before the problem is identified by a human operator.

It's a catch-all exception - "Common exception for the SimpleEmailServiceV2 service." - so the app has no way to differentiate between config errors and other errors.