Permalink
Browse files

Clearer error messages.

  • Loading branch information...
1 parent d0c07f4 commit dbe66124104e50ba49e1ac9d0538c32ccc4763f3 @aljimenez aljimenez committed Jun 13, 2014
Showing with 5 additions and 5 deletions.
  1. +4 −4 lib/app/autoload/dispatch.server.js
  2. +1 −1 lib/app/autoload/store.server.js
View
8 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
View
2 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] = {};

0 comments on commit dbe6612

Please sign in to comment.