airavata-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From machris...@apache.org
Subject [airavata-django-portal] 02/05: AIRAVATA-2727 Handle uncaught TExceptions
Date Fri, 17 Aug 2018 19:35:58 GMT
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 <machrist@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") {


Mime
View raw message