mirror of
https://github.com/puppeteer/puppeteer
synced 2024-06-14 14:02:48 +00:00
fix(helpers): support thrown strings and numbers in getExceptionMessage (#2715)
Of course, strings aren't proper errors, but scripts sometimes do that, and Puppeteer loses such error messages.
This commit is contained in:
committed by
Andrey Lushnikov
parent
93e128931f
commit
9498b1057b
@@ -61,7 +61,7 @@ class Helper {
|
||||
*/
|
||||
static getExceptionMessage(exceptionDetails) {
|
||||
if (exceptionDetails.exception)
|
||||
return exceptionDetails.exception.description;
|
||||
return exceptionDetails.exception.description || exceptionDetails.exception.value;
|
||||
let message = exceptionDetails.text;
|
||||
if (exceptionDetails.stackTrace) {
|
||||
for (const callframe of exceptionDetails.stackTrace.callFrames) {
|
||||
|
||||
Reference in New Issue
Block a user