Skip to content
This repository has been archived by the owner on Oct 30, 2018. It is now read-only.

Commit

Permalink
Clearer error messages.
Browse files Browse the repository at this point in the history
  • Loading branch information
aljimenez committed Jun 13, 2014
1 parent d0c07f4 commit dbe6612
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
8 changes: 4 additions & 4 deletions lib/app/autoload/dispatch.server.js
Expand Up @@ -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;
}
Expand All @@ -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
Expand Down
2 changes: 1 addition & 1 deletion lib/app/autoload/store.server.js
Expand Up @@ -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] = {};
Expand Down

0 comments on commit dbe6612

Please sign in to comment.