Эх сурвалжийг харах

HUE-8888 [editor] Avoid 500 error when opening a non existing saved query

Romain 5 жил өмнө
parent
commit
12024633a2

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

@@ -53,7 +53,10 @@ def check_editor_access_permission():
         pass
       else:
         if editor_id:  # Open existing saved editor document
-          editor_type = _get_editor_type(editor_id)
+          try:
+            editor_type = _get_editor_type(editor_id)
+          except Document2.DoesNotExist:
+            raise PopupException(_('Query id %s can not be found, please open a new editor') % editor_id)
 
         if check_permissions(request.user, editor_type):
           raise PopupException(_('Missing permission to access the %s Editor' % editor_type), error_code=401)