Skip to content

Commit

Permalink
devtools: try to extract description from exceptions in evalInContext
Browse files Browse the repository at this point in the history
  • Loading branch information
darwin committed Sep 7, 2016
1 parent 41f057c commit 5aae5ca
Showing 1 changed file with 15 additions and 1 deletion.
16 changes: 15 additions & 1 deletion resources/unpacked/devtools/front_end/dirac_lazy/dirac_lazy.js
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,21 @@ Object.assign(window.dirac, (function() {
console.log("evalInContext/resultCallback: result", result, "exceptionDetails", exceptionDetails);
}
if (callback) {
callback(result, exceptionDetails);
var exceptionDescription = null;
if (exceptionDetails) {
const exception = exceptionDetails.exception;
if (exception) {
exceptionDescription = exception.description;
}
if (!exceptionDescription) {
exceptionDescription = exceptionDetails.text;
}
if (!exceptionDescription) {
exceptionDescription = "?";
}
}

callback(result, exceptionDescription);
}
};
try {
Expand Down

0 comments on commit 5aae5ca

Please sign in to comment.