From dbe66124104e50ba49e1ac9d0538c32ccc4763f3 Mon Sep 17 00:00:00 2001 From: Albert Jimenez Date: Fri, 13 Jun 2014 16:50:55 -0700 Subject: [PATCH] Clearer error messages. --- lib/app/autoload/dispatch.server.js | 8 ++++---- lib/app/autoload/store.server.js | 2 +- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/lib/app/autoload/dispatch.server.js b/lib/app/autoload/dispatch.server.js index 40591d4ef..72e45e077 100644 --- a/lib/app/autoload/dispatch.server.js +++ b/lib/app/autoload/dispatch.server.js @@ -144,7 +144,7 @@ YUI.add('mojito-dispatcher', function (Y, NAME) { errorMessage = 'Error expanding instance for "' + (command.instance.id || command.instance.base || command.instance.type) + '"'; Y.log(errorMessage + (err ? ': \n' + err.stack : - instance && !instance.controller ? ': no valid controller found for the "' + instance.type + '" mojit' : ''), 'error', NAME); + instance && !instance.controller ? ': no valid controller found in the "' + instance.type + '" mojit' : ''), 'error', NAME); adapter.error(new Error(errorMessage)); return; } @@ -153,10 +153,10 @@ YUI.add('mojito-dispatcher', function (Y, NAME) { command.instance = instance; if (!Y.mojito.controllers[instance.controller]) { - errorMessage = 'Invalid controller for the "' + command.instance.type + '" mojit'; + errorMessage = 'Invalid controller, named "' + instance.controller + '", in the "' + command.instance.type + '" mojit'; // the controller was not found, we should halt - Y.log(errorMessage + '. The controller name "' + instance.controller + - '" did not set its actions under Y.namespace(\'mojito.controllers\')[\'' + instance.controller + '\']', 'error', NAME); + Y.log(errorMessage + '. The controller does not define its actions under Y.namespace(\'mojito.controllers\')[\'' + + instance.controller + '\']', 'error', NAME); adapter.error(new Error(errorMessage)); } else { // dispatching AC diff --git a/lib/app/autoload/store.server.js b/lib/app/autoload/store.server.js index 142c4d854..753e3a1a8 100644 --- a/lib/app/autoload/store.server.js +++ b/lib/app/autoload/store.server.js @@ -1653,7 +1653,7 @@ YUI.add('mojito-resource-store', function(Y, NAME) { ress = this._mojitRVs[type]; if (!ress) { - throw new Error('Cannot find the "' + type + '" mojit. Make sure "' + type + '" exists in the application."'); + throw new Error('Cannot find the "' + type + '" mojit. Make sure "' + type + '" exists in the application.'); } this._mojitDetails[type] = {};