Skip to content
Snippets Groups Projects
Commit 23c242cb authored by michael.minelli's avatar michael.minelli
Browse files

EnonceCreate => Error handling

parent 1958ecff
No related branches found
No related tags found
No related merge requests found
Pipeline #25241 passed
...@@ -82,9 +82,15 @@ class DojoBackendManager { ...@@ -82,9 +82,15 @@ class DojoBackendManager {
} catch ( error ) { } catch ( error ) {
if ( verbose ) { if ( verbose ) {
if ( error instanceof AxiosError ) { if ( error instanceof AxiosError ) {
spinner.fail(`Error...`); if ( error.response ) {
if ( error.response.status === StatusCodes.CONFLICT ) {
spinner.fail(`The template name is already used. Please choose another name.`);
} else {
spinner.fail(`Template creation error: ${ error.response.statusText }`);
}
}
} else { } else {
spinner.fail(`Error...`); spinner.fail(`Template creation error: unknown error`);
} }
} }
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment