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

Commit

Permalink
don't throw() during expandInstanceForEnv()
Browse files Browse the repository at this point in the history
  • Loading branch information
drewfish committed Sep 5, 2012
1 parent a1cbb26 commit af6fa37
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions lib/app/autoload/store.client.js
Original file line number Diff line number Diff line change
Expand Up @@ -141,7 +141,7 @@ YUI.add('mojito-client-store', function(Y, NAME) {
* @param {object} ctx The runtime context.
* @param {function} cb Callback used to return the results (or error).
* @param {null|Error} cb.err Error encountered while attempting to service the request.
* @param {object} cb.instance The expanded instance.
* @param {object|undefined} cb.instance The expanded instance, or undefined on error.
*/
expandInstanceForEnv: function(env, inInstance, context, callback) {
var source = {};
Expand All @@ -155,15 +155,16 @@ YUI.add('mojito-client-store', function(Y, NAME) {
source.func = this._getType;
} else {
// We don't have any inputs so fail
throw new Error('There was no "base" or "type" in the "instance" object');
callback(new Error('There was no "base" or "type" in the "instance" object'), undefined);
return;
}

// Here we get either a spec or a type.
source.func(env, source.name, context, function(err, remoteInstance) {
var outInstance;

if (err) {
callback(err, {});
callback(err, undefined);
return;
}

Expand Down

0 comments on commit af6fa37

Please sign in to comment.