mirror of
https://github.com/fleetdm/fleet
synced 2026-05-24 09:28:54 +00:00
Settings Page: Render SMTP port error (#4239)
This commit is contained in:
parent
2cf1074bf9
commit
689de41878
2 changed files with 18 additions and 3 deletions
1
changes/issue-4187-render-smtp-error
Normal file
1
changes/issue-4187-render-smtp-error
Normal file
|
|
@ -0,0 +1 @@
|
|||
* Render more helpful SMTP error when cannot configure SMTP server
|
||||
|
|
@ -58,9 +58,23 @@ const AppSettingsPage = (): JSX.Element => {
|
|||
.then(() => {
|
||||
dispatch(renderFlash("success", "Successfully updated settings."));
|
||||
})
|
||||
.catch((errors: any) => {
|
||||
if (errors.base) {
|
||||
dispatch(renderFlash("error", errors.base));
|
||||
.catch((response: any) => {
|
||||
if (
|
||||
response.data.errors[0].reason.includes("could not dial smtp host")
|
||||
) {
|
||||
dispatch(
|
||||
renderFlash(
|
||||
"error",
|
||||
"Could not connect to SMTP server. Please try again."
|
||||
)
|
||||
);
|
||||
} else if (response.data.errors) {
|
||||
dispatch(
|
||||
renderFlash(
|
||||
"error",
|
||||
`Could not update settings. ${response.data.errors[0].reason}`
|
||||
)
|
||||
);
|
||||
}
|
||||
})
|
||||
.finally(() => {
|
||||
|
|
|
|||
Loading…
Reference in a new issue