From 5aae5cafc843bbd160677c17105a2882f3b64ab2 Mon Sep 17 00:00:00 2001 From: Antonin Hildebrand Date: Wed, 7 Sep 2016 23:04:40 +0200 Subject: [PATCH] devtools: try to extract description from exceptions in evalInContext --- .../devtools/front_end/dirac_lazy/dirac_lazy.js | 16 +++++++++++++++- 1 file changed, 15 insertions(+), 1 deletion(-) diff --git a/resources/unpacked/devtools/front_end/dirac_lazy/dirac_lazy.js b/resources/unpacked/devtools/front_end/dirac_lazy/dirac_lazy.js index 70f74a6af9..cba6c4c2ad 100644 --- a/resources/unpacked/devtools/front_end/dirac_lazy/dirac_lazy.js +++ b/resources/unpacked/devtools/front_end/dirac_lazy/dirac_lazy.js @@ -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 {