From: Galen Charlton Date: Tue, 9 Nov 2021 15:41:58 +0000 (-0500) Subject: LP#1855780: improve reporting of event test errors X-Git-Url: https://old-git.evergreen-ils.org/?a=commitdiff_plain;h=2600680797b7943ba28f474779eb2fcac1fff30f;p=evergreen%2Ftadl.git LP#1855780: improve reporting of event test errors - make error title/caption strings available to i18n - catch and report on exceptions, not just ILS events Signed-off-by: Galen Charlton Signed-off-by: Jane Sandberg --- diff --git a/Open-ILS/src/eg2/src/app/staff/admin/local/triggers/trigger-edit.component.html b/Open-ILS/src/eg2/src/app/staff/admin/local/triggers/trigger-edit.component.html index 29f54a787f..6aaa890871 100644 --- a/Open-ILS/src/eg2/src/app/staff/admin/local/triggers/trigger-edit.component.html +++ b/Open-ILS/src/eg2/src/app/staff/admin/local/triggers/trigger-edit.component.html @@ -95,3 +95,8 @@ + + + Error when testing event defintion ({{ilsevent}}: {{textcode}}): + + diff --git a/Open-ILS/src/eg2/src/app/staff/admin/local/triggers/trigger-edit.component.ts b/Open-ILS/src/eg2/src/app/staff/admin/local/triggers/trigger-edit.component.ts index dcd34e05ae..9b665b627a 100644 --- a/Open-ILS/src/eg2/src/app/staff/admin/local/triggers/trigger-edit.component.ts +++ b/Open-ILS/src/eg2/src/app/staff/admin/local/triggers/trigger-edit.component.ts @@ -46,6 +46,8 @@ export class EditEventDefinitionComponent implements OnInit { @ViewChild('deleteSuccessString') deleteSuccessString: StringComponent; @ViewChild('createSuccessString') createSuccessString: StringComponent; @ViewChild('createErrString') createErrString: StringComponent; + @ViewChild('eventDuringTestString') eventDuringTestString: StringComponent; + @ViewChild('errorDuringTestString') errorDuringTestString: StringComponent; constructor( private router: Router, @@ -190,11 +192,16 @@ export class EditEventDefinitionComponent implements OnInit { ).subscribe(res => { this.testDone = true; if (res.ilsevent) { - this.testErr1 = 'Event: ' + res.ilsevent + ': ' + res.textcode + ' ->'; + this.eventDuringTestString.current({ ilsevent: res.ilsevent, textcode : res.textcode}) + .then(str => this.testErr1 = str); this.testErr2 = res.desc; } else { this.testResult = res.template_output().data(); } + }, err => { + this.testDone = true; + this.errorDuringTestString.current().then(str => this.testErr1 = str); + this.testErr2 = err; }); }