Skip to content
This repository has been archived by the owner on Sep 6, 2021. It is now read-only.

Show LESS errors in console #8736

Merged
merged 2 commits into from
Oct 13, 2014
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 6 additions & 1 deletion src/utils/ExtensionUtils.js
Original file line number Diff line number Diff line change
Expand Up @@ -122,7 +122,12 @@ define(function (require, exports, module) {
if (err) {
result.reject(err);
} else {
result.resolve(tree.toCSS());
try {
result.resolve(tree.toCSS());
} catch (toCSSError) {
console.error(toCSSError.filename + ":" + toCSSError.line + " " + toCSSError.message);
Copy link
Member

Choose a reason for hiding this comment

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

@jasonsanjose On master, I assume the uncaught exception falls through to the top of the stack, causing dev tools to log a stack trace plus the value of toCSSError.toString(). Does the toString() not include this info already? Or were you not even seeing the exception getting logged at all for some reason?

Copy link
Member Author

Choose a reason for hiding this comment

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

Right, uncaught exception without a useful toString():

image

result.reject(toCSSError);
}
}
});

Expand Down