refs #1550. Improve error handling in ManageOrganizationalUnitComponent by parsing and cleaning error messages for better user feedback
testing/ogGui-multibranch/pipeline/head There was a failure building this commit
Details
testing/ogGui-multibranch/pipeline/head There was a failure building this commit
Details
parent
56966fd767
commit
f1ddf20d0c
|
@ -284,7 +284,11 @@ export class ManageOrganizationalUnitComponent implements OnInit {
|
||||||
},
|
},
|
||||||
error => {
|
error => {
|
||||||
console.error('Error al realizar PUT:', error);
|
console.error('Error al realizar PUT:', error);
|
||||||
this.toastService.error('Error al editar:', error);
|
const errorMessages = error.error['hydra:description'].split('\n');
|
||||||
|
errorMessages.forEach((message: string) => {
|
||||||
|
const cleanedMessage = message.replace(/networkSettings\.(\w+):/, 'Error $1:');
|
||||||
|
this.toastService.error(cleanedMessage);
|
||||||
|
});
|
||||||
}
|
}
|
||||||
);
|
);
|
||||||
} else {
|
} else {
|
||||||
|
@ -299,7 +303,11 @@ export class ManageOrganizationalUnitComponent implements OnInit {
|
||||||
},
|
},
|
||||||
error => {
|
error => {
|
||||||
console.error('Error al realizar POST:', error);
|
console.error('Error al realizar POST:', error);
|
||||||
this.toastService.error('Error al crear:', error.error['hydra:description']);
|
const errorMessages = error.error['hydra:description'].split('\n');
|
||||||
|
errorMessages.forEach((message: string) => {
|
||||||
|
const cleanedMessage = message.replace(/networkSettings\.(\w+):/, 'Error $1:');
|
||||||
|
this.toastService.error(cleanedMessage);
|
||||||
|
});
|
||||||
}
|
}
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
|
@ -56,7 +56,7 @@ body {
|
||||||
|
|
||||||
.ordinary-button {
|
.ordinary-button {
|
||||||
background-color: #fafafa;
|
background-color: #fafafa;
|
||||||
color: #5f5f5f;
|
color: #3d3d3d;
|
||||||
padding: 8px 18px;
|
padding: 8px 18px;
|
||||||
border: 1px solid #5f5f5f;
|
border: 1px solid #5f5f5f;
|
||||||
border-radius: 4px;
|
border-radius: 4px;
|
||||||
|
|
Loading…
Reference in New Issue