Skip to content

Commit

Permalink
Adds reason to SES exceptions (#42426)
Browse files Browse the repository at this point in the history
  • Loading branch information
nunomaduro authored May 18, 2022
1 parent 0e73d4d commit 0da9f21
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion src/Illuminate/Mail/Transport/SesTransport.php
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,13 @@ protected function doSend(SentMessage $message): void
)
);
} catch (AwsException $e) {
throw new Exception('Request to AWS SES API failed.', is_int($e->getCode()) ? $e->getCode() : 0, $e);
$reason = $e->getAwsErrorMessage() ?? $e->getMessage();

throw new Exception(
sprintf('Request to AWS SES API failed. Reason: %s.', $reason),
is_int($e->getCode()) ? $e->getCode() : 0,
$e
);
}

$messageId = $result->get('MessageId');
Expand Down

0 comments on commit 0da9f21

Please sign in to comment.