diff --git a/h5c/vic/src/vic-webapp/src/app/vch-view/vch-view.component.ts b/h5c/vic/src/vic-webapp/src/app/vch-view/vch-view.component.ts index 4389b5935..d85d58bd8 100644 --- a/h5c/vic/src/vic-webapp/src/app/vch-view/vch-view.component.ts +++ b/h5c/vic/src/vic-webapp/src/app/vch-view/vch-view.component.ts @@ -289,10 +289,13 @@ export class VicVchViewComponent implements OnInit, OnDestroy { if (data.eventType === DELETE_VCH_MODAL_ERROR_EVENT) { this.zone.run(() => { let payload; + let body; try { - payload = JSON.parse(data.payload) + payload = JSON.parse(data.payload); + body = JSON.parse(payload._body); } catch (e) {} - this.error = payload.message || 'Error trying to delete the VCH'; + const errMsg = 'Error trying to delete the VCH.'; + this.error = body.message ? errMsg + ' ' + body.message : errMsg; }); } else if (data.eventType === DATAGRID_REFRESH_EVENT) { this.zone.run(() => {