X-Git-Url: https://git.mdrn.pl/fnpeditor.git/blobdiff_plain/d0bf0dec6f6c72fb6dd3bccccbabf858c71368a0..68c9d615c3b5f4d6fefcd721f0315fde89fc3328:/src/fnpjs/actions.js diff --git a/src/fnpjs/actions.js b/src/fnpjs/actions.js index d369ff0..c49373a 100644 --- a/src/fnpjs/actions.js +++ b/src/fnpjs/actions.js @@ -3,7 +3,11 @@ define(function(require) { 'use strict'; var _ = require('libs/underscore'), - Backbone = require('libs/backbone'); + Backbone = require('libs/backbone'), + logging = require('fnpjs/logging/logging'); + +var logger = logging.getLogger('fnpjs.actions'); + var Action = function(fqName, definition, config, appObject) { this.fqName = fqName; @@ -52,7 +56,12 @@ _.extend(Action.prototype, Backbone.Events, { getState: function() { var gotState; if(!this._cache) { - gotState = this.definition.getState.call(this, this.params); + try { + gotState = this.definition.getState.call(this, this.params); + } catch(e) { + logger.exception(e); + return; + } if(typeof gotState === 'boolean') { gotState = {allowed: gotState}; }