Skip to content
This repository has been archived by the owner on Feb 6, 2022. It is now read-only.

Throwing Exception for bad URL formats #273

Merged
merged 1 commit into from Apr 18, 2019
Merged

Throwing Exception for bad URL formats #273

merged 1 commit into from Apr 18, 2019

Conversation

maitre-hibou
Copy link
Contributor

Hello there,

Description : When supplying a wrong URL format in the MAILER_URL environment variable, Swiftmailer Transport component is initialized with bundle default configuration values.
Therefore, when trying to send emails, a "silent" error is triggered with the following message : Exception occurred while flushing email queue: Connection could not be established with host localhost [Address not available #99].

Changes made : This PR now throws an InvalidArgumentException if supplied URL is not parseable by PHP's parse_url method.

@fabpot
Copy link
Member

fabpot commented Apr 18, 2019

Thank you @maitre-hibou.

@fabpot fabpot merged commit c31bc23 into symfony:master Apr 18, 2019
fabpot added a commit that referenced this pull request Apr 18, 2019
This PR was squashed before being merged into the 3.2-dev branch (closes #273).

Discussion
----------

Throwing Exception for bad URL formats

Hello there,

**Description** : When supplying a wrong URL format in the `MAILER_URL` environment variable, Swiftmailer Transport component is initialized with bundle default configuration values.
Therefore, when trying to send emails, a "silent" error is triggered with the following message : `Exception occurred while flushing email queue: Connection could not be established with host localhost [Address not available #99]`.

**Changes made** : This PR now throws an `InvalidArgumentException` if supplied URL is not parseable by PHP's `parse_url` method.

Commits
-------

c31bc23 Throwing Exception for bad URL formats
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants