CreateImageWizard: add creation failure alert

When image creation failed to start the wizard would get stuck in the
saving state with no notice to the user. Now the user will get an error
alert contain the status code and message. The wizard no longer gets
stuck in the saving state.
This commit is contained in:
Jacob Kozol 2021-10-21 18:07:45 +02:00 committed by Tom Gundersen
parent 933218376b
commit 7ea8168443

View file

@ -135,6 +135,15 @@ const CreateImageWizard = () => {
title: 'Your image is being created',
}));
setIsSaving(false);
})
.catch((err) => {
dispatch(addNotification({
variant: 'danger',
title: 'Your image could not be created',
description: 'Status code ' + err.response.status + ': ' + err.response.statusText,
}));
setIsSaving(false);
});
} }