diff --git a/src/Effect.Email.purs b/src/Effect.Email.purs index 494416d..890e6de 100644 --- a/src/Effect.Email.purs +++ b/src/Effect.Email.purs @@ -84,12 +84,12 @@ deliverableOnce :: Email -> ExceptT EmailError Aff Email deliverableOnce email' = do let email = Email.toString email' { reachable, syntax, mx, smtp } <- lift $ Promise.toAffE $ checkEmailImpl email - when (not reachable) $ throwError $ EmailUnreachable email' when (not syntax.valid) $ throwError $ EmailSyntaxInvalid email' when (not mx.valid) $ throwError $ EmailMXInvalid email' when (not smtp.valid) $ throwError $ EmailSMTPInvalid email' when (maybe true Array.null $ Nullable.toMaybe $ mx.mxRecords) $ throwError $ EmailMXNoRecords email' for_ (Nullable.toMaybe $ smtp.error) $ throwError <<< EmailSMTPError email' + when (not reachable) $ throwError $ EmailUnreachable email' pure email' deliverable :: Email -> ExceptT EmailError Aff Email