]> git.proxmox.com Git - proxmox-widget-toolkit.git/blobdiff - src/Utils.js
Utils: add errorCallback to monStoreErrors
[proxmox-widget-toolkit.git] / src / Utils.js
index e1cddc81fdb18f7b8739dbbd67e10daef4091f63..b8aabda24702ce9506b14397fd73aea77881408d 100644 (file)
@@ -317,7 +317,7 @@ utilities: {
        return msg.join('<br>');
     },
 
-    monStoreErrors: function(component, store, clearMaskBeforeLoad) {
+    monStoreErrors: function(component, store, clearMaskBeforeLoad, errorCallback) {
        if (clearMaskBeforeLoad) {
            component.mon(store, 'beforeload', function(s, operation, eOpts) {
                Proxmox.Utils.setErrorMask(component, false);
@@ -342,7 +342,9 @@ utilities: {
 
            let error = request._operation.getError();
            let msg = Proxmox.Utils.getResponseErrorMessage(error);
-           Proxmox.Utils.setErrorMask(component, msg);
+           if (!errorCallback || !errorCallback(error, msg)) {
+               Proxmox.Utils.setErrorMask(component, msg);
+           }
        });
     },