You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@airavata.apache.org by ma...@apache.org on 2018/08/17 19:35:58 UTC

[airavata-django-portal] 02/05: AIRAVATA-2727 Handle uncaught TExceptions

This is an automated email from the ASF dual-hosted git repository.

machristie pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/airavata-django-portal.git

commit ceb0b5bcaad38ff50fc5c1b18ad21b65d2b32217
Author: Marcus Christie <ma...@iu.edu>
AuthorDate: Fri Aug 17 14:34:15 2018 -0400

    AIRAVATA-2727 Handle uncaught TExceptions
---
 django_airavata/apps/api/exceptions.py                             | 7 +++++--
 .../static/common/js/components/NotificationsDisplay.vue           | 2 +-
 2 files changed, 6 insertions(+), 3 deletions(-)

diff --git a/django_airavata/apps/api/exceptions.py b/django_airavata/apps/api/exceptions.py
index 4075189..632d97c 100644
--- a/django_airavata/apps/api/exceptions.py
+++ b/django_airavata/apps/api/exceptions.py
@@ -4,6 +4,7 @@ import logging
 from rest_framework import serializers, status
 from rest_framework.response import Response
 from rest_framework.views import exception_handler
+from thrift.Thrift import TException
 
 from airavata.api.error.ttypes import AiravataSystemException
 
@@ -15,8 +16,10 @@ def custom_exception_handler(exc, context):
     # to get the standard error response.
     response = exception_handler(exc, context)
 
-    if isinstance(exc, AiravataSystemException):
-        log.error("AiravataSystemException", exc_info=exc)
+    # Default TException handler, should come after more specific subclasses of
+    # TException
+    if isinstance(exc, TException):
+        log.error("TException", exc_info=exc)
         return Response(
             {'detail': str(exc)},
             status=status.HTTP_500_INTERNAL_SERVER_ERROR)
diff --git a/django_airavata/static/common/js/components/NotificationsDisplay.vue b/django_airavata/static/common/js/components/NotificationsDisplay.vue
index 6a71aac..d725d6c 100644
--- a/django_airavata/static/common/js/components/NotificationsDisplay.vue
+++ b/django_airavata/static/common/js/components/NotificationsDisplay.vue
@@ -47,7 +47,7 @@ export default {
             NotificationList.remove(notification);
         },
         dismissedError: function(error) {
-            errors.UnhandledErrorList.remove(error.details);
+            errors.UnhandledErrorDisplayList.remove(error.details);
         },
         variant: function(notification) {
             if (notification.type === "SUCCESS") {