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

Commit

Permalink
Merge pull request #9557 from adobe/pflynn/better-less-errors
Browse files Browse the repository at this point in the history
Show LESS errors in console, more thoroughly
  • Loading branch information
redmunds committed Dec 5, 2014
2 parents 23a2556 + c625d02 commit 04efd92
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 04efd92

Please sign in to comment.