Browse Source

[notebook][api] Remove Solr error handling method to fix json decode exception issue (#3940)

- Improve sending error message in old notebook API decorator to fix json decode issue origination from the function used for Solr APIs.
Harsh Gupta 10 tháng trước cách đây
mục cha
commit
e5be62599c
1 tập tin đã thay đổi với 1 bổ sung3 xóa
  1. 1 3
      desktop/libs/notebook/src/notebook/decorators.py

+ 1 - 3
desktop/libs/notebook/src/notebook/decorators.py

@@ -27,7 +27,6 @@ from django.utils.functional import wraps
 from django.utils.translation import gettext as _
 from past.builtins import basestring
 
-from dashboard.models import extract_solr_exception_message
 from desktop.conf import ENABLE_HUE_5
 from desktop.lib.django_util import JsonResponse
 from desktop.lib.exceptions_renderable import PopupException
@@ -162,9 +161,8 @@ def api_error_handler(f):
       response['status'] = 5
       response['message'] = e.message
     except RestException as e:
-      message = extract_solr_exception_message(e)
       response['status'] = 1
-      response['message'] = message.get('error')
+      response['message'] = e.message  # TODO: Improve error UX further with better context
     except Exception as e:
       LOG.exception('Error running %s' % f.__name__)
       response['status'] = -1