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

Commit

Permalink
Refinement of PR #8736: also log LESS errors from the parsing stage t…
Browse files Browse the repository at this point in the history
…o the

console (not just the output stage). Also covers cases where the file
doesn't exist, for both CSS & LESS.
  • Loading branch information
peterflynn committed Dec 5, 2014
1 parent 50869ee commit c625d02
Showing 1 changed file with 10 additions and 1 deletion.
11 changes: 10 additions & 1 deletion src/utils/ExtensionUtils.js
Original file line number Diff line number Diff line change
Expand Up @@ -125,7 +125,6 @@ define(function (require, exports, module) {
try {
result.resolve(tree.toCSS());
} catch (toCSSError) {
console.error(toCSSError.filename + ":" + toCSSError.line + " " + toCSSError.message);
result.reject(toCSSError);
}
}
Expand Down Expand Up @@ -220,6 +219,16 @@ define(function (require, exports, module) {
})
.fail(result.reject);

// Summarize error info to console for easier debugging
result.fail(function (error, textStatus, httpError) {
if (error.readyState !== undefined) {
// If first arg is a jQXHR object, the real error info is in the next two args
console.error("[Extension] Unable to read stylesheet " + path + ":", textStatus, httpError);
} else {
console.error("[Extension] Unable to process stylesheet " + path, error);
}
});

return result.promise();
}

Expand Down

0 comments on commit c625d02

Please sign in to comment.