Sha256: c800c8cde93fc967a9716b190ccfd5906efc8aeb665bc2b977f9a8dd402289a6

Contents?: true

Size: 656 Bytes

Versions: 4

Compression:

Stored size: 656 Bytes

Contents

'use strict';

(function () {
  _.extend(scrivito, {
    handleAjaxError: function handleAjaxError(error) {
      var message = undefined;

      // -- PATCH BEGINS HERE --
      if (typeof error === 'object' && error.message) {
        scrivito.alertDialog(error.message);
      } else {
        message = scrivito.t('ajax_error.communication');
        scrivito.errorDialog(scrivito.t('ajax_error.message_for_editor'), [message]);
      }
      // -- PATCH ENDS HERE --

      scrivito.logError(error);
    },

    withAjaxErrorHandling: function withAjaxErrorHandling(promise) {
      return promise['catch'](scrivito.handleAjaxError);
    }
  });
})();

Version data entries

4 entries across 4 versions & 1 rubygems

Version Path
infopark_fiona7-1.5.3.2.0 app/assets/javascripts/scrivito_patches/ajax_error_handling.js
infopark_fiona7-1.5.3.2.0.pre.beta1 app/assets/javascripts/scrivito_patches/ajax_error_handling.js
infopark_fiona7-1.5.2.1.0.pre.beta1 app/assets/javascripts/scrivito_patches/ajax_error_handling.js
infopark_fiona7-1.5.2.0.0 app/assets/javascripts/scrivito_patches/ajax_error_handling.js