Browse Source

HUE-8300 [editor] Silence all AuthorizationExceptions in the editor

Johan Ahlen 7 years ago
parent
commit
1c75ae4f88
1 changed files with 4 additions and 2 deletions
  1. 4 2
      desktop/core/src/desktop/static/desktop/js/apiHelper.js

+ 4 - 2
desktop/core/src/desktop/static/desktop/js/apiHelper.js

@@ -358,7 +358,7 @@ var ApiHelper = (function () {
             } else {
               errorMessage = errorResponse.responseText;
             }
-          } catch(err) {
+          } catch (err) {
             errorMessage = errorResponse.responseText;
           }
         } else if (typeof errorResponse.message !== 'undefined' && errorResponse.message !== null) {
@@ -374,7 +374,9 @@ var ApiHelper = (function () {
 
       if (!options || !options.silenceErrors) {
         hueUtils.logError(errorResponse);
-        $(document).trigger("error", errorMessage);
+        if (errorMessage && errorMessage.indexOf('AuthorizationException') === -1) {
+          $(document).trigger("error", errorMessage);
+        }
       }
 
       if (options && options.errorCallback) {