craigpaul / laravel-postmark

A Postmark adapter for Laravel
MIT License
204 stars 23 forks source link

Throw Swift_TransportException for GuzzleConnect and GuzzleServer exc… #127

Closed mattyh88 closed 3 years ago

mattyh88 commented 3 years ago

The current implementation of the package throws a GuzzleConnect or GuzzleServer error in case Postmark can't handle the given request. In order for the (relatively new) Laravel failover mail driver to work, we should throw a Swift_TransportException instead. (Please see the send() function of the Swift_Transport_FailoverTransport class)

Description

Please see the general summary.

Motivation and context

This PR will make sure that the (relatively new) failover mail driver will work properly.

How has this been tested?

I tested the changes, I made to this package, in a working Laravel 8.58.0 application. I've (temp) changed the value of POSTMARK_BASE_URI to a faulty domain. Thus I received a GuzzleConnect exception. The change I made took care of throwing a Swift_TransportException based on that GuzzleConnect exception.

Screenshots (if appropriate)

Types of changes

I'm not really sure if this is a bug-fix or breaking change. I guess it's a breaking change as the send() function will now throw that Swift_TransportException instead of the GuzzleConnect & GuzzleServer Exceptions.

Checklist:

If you're unsure about any of these, don't hesitate to ask. We're here to help!