Skip to content

Commit

Permalink
Clearer error reporting on missing components.
Browse files Browse the repository at this point in the history
  • Loading branch information
Tom MacWright committed Mar 11, 2011
1 parent 98b4c49 commit 9589427
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion lib/record.js
Expand Up @@ -42,7 +42,11 @@ wax.Record = function(obj, context) {
var ret = _.reduce(head.split('.'), function(part, segment) {
return [part[1] || part[0], part[1] ? part[1][segment] : part[0][segment]];
}, [cur || window, null]);
return ret;
if (ret[0] && ret[1]) {
return ret;
} else {
throw head + ' not found.';
}
};
var makeObject = function(fn_name, args) {
var fn_obj = getFunction(fn_name),
Expand Down

0 comments on commit 9589427

Please sign in to comment.