Skip to content
This repository has been archived by the owner on Jun 28, 2022. It is now read-only.

Commit

Permalink
runat-1128988: Improve 'type not found' debugging
Browse files Browse the repository at this point in the history
Signed-off-by: Joe Walker <[email protected]>
  • Loading branch information
joewalker committed Feb 6, 2015
1 parent dc4a419 commit dba9008
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion lib/gcli/system.js
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,13 @@ exports.createSystem = function(options) {
};

var addItem = function(item) {
components[getItemType(item)].add(item);
try {
components[getItemType(item)].add(item);
}
catch (ex) {
console.error('While adding: ' + item.name);

This comment has been minimized.

Copy link
@bgrins

bgrins Feb 24, 2015

What if item is undefined / null?

This comment has been minimized.

Copy link
@joewalker

joewalker Mar 5, 2015

Author Owner

Good spot. I've added a null check to the console.error

throw ex;
}
};

var removeItem = function(item) {
Expand Down

1 comment on commit dba9008

@bgrins
Copy link

@bgrins bgrins commented on dba9008 Feb 24, 2015

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

r+

Please sign in to comment.