Skip to content

Commit

Permalink
Add error handling
Browse files Browse the repository at this point in the history
  • Loading branch information
t32k committed Mar 26, 2014
1 parent a25ea10 commit 262bf61
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion lib/parser.js
Expand Up @@ -101,8 +101,10 @@ Parser.prototype.parse = function(callback) {
$('style').each(function() {
that.styles.push($(this).text());
});
} else {
} else if (response.headers['content-type'].indexOf('css') > -1) {
that.styles.push(response.body);
} else {
throw new Error('Content type is not HTML or CSS!');
}
});

Expand Down

1 comment on commit 262bf61

@1000ch
Copy link
Collaborator

@1000ch 1000ch commented on 262bf61 Mar 26, 2014

Choose a reason for hiding this comment

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

👍

Please sign in to comment.