From 18d704ea9d6e52bc07adae86063f7d630c6e35bd Mon Sep 17 00:00:00 2001
From: Chris Hines <chris.hines@monash.edu>
Date: Wed, 13 May 2020 10:35:20 +1000
Subject: [PATCH] fix up error logs

---
 src/app/tes.service.ts | 21 +++++++++++++++++----
 1 file changed, 17 insertions(+), 4 deletions(-)

diff --git a/src/app/tes.service.ts b/src/app/tes.service.ts
index 0efdf8b..e6cb971 100644
--- a/src/app/tes.service.ts
+++ b/src/app/tes.service.ts
@@ -169,21 +169,34 @@ private addUserHealth(identity,resp) {
 
  submissionError(error: any) {
    if (error.status != 0) {
-       if ('error' in error && 'message' in error.error) {
+       try {
+         this.notifications.notify(error.error.message);
+       } catch {
+         this.notifications.notify('Job Canceling failed');
+         console.error(error);
+       }
+       /*if ('error' in error && 'message' in error.error) {
          this.notifications.notify(error.error.message);
        } else {
          this.notifications.notify('Job submission failed');
-       }
+       }*/
    }
  }
 
  cancelError(error: any) {
    if (error.status != 0) {
-       if ('error' in error && 'message' in error.error) {
+       try {
          this.notifications.notify(error.error.message);
-       } else {
+       } catch {
          this.notifications.notify('Job Canceling failed');
+         console.error(error);
        }
+
+       /*if ('error' in error && 'message' in error.error) {
+         this.notifications.notify(error.error.message);
+       } else {
+         this.notifications.notify('Job Canceling failed');
+       }*/
    }
  }
 
-- 
GitLab