Handle invalid alert address in alert sending #2661
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
When we try to send an alert, but the alert address is empty currently no alert is sent, an error is logged, but it is reported back as a successful sending, which can become very confusing.
This PR fixes that and even widens the application. Before sending an alert the address it is to be sent to is validated and in case it is invalid an error is logged and an
InvalidAlertAddressError
is thrown. That is caught further up and the alert is deleted in that case and the sending is reported back as failed.This popped up due to #1787.