Workers not logging objects

Tried to log an exception that was thrown but all it logged was: How can we debug better in workers?
{
"message": [
"mylog",
"[object Object]"
],
"level": "log",
"timestamp": 1701263872409
},
{
"message": [
"mylog",
"[object Object]"
],
"level": "log",
"timestamp": 1701263872409
},
By using JSON.stringifiyit printed out empty object "{}",
3 Replies
kian
kian15mo ago
If it's an Error object then JSON.stringify alone doesn't work on them
sten
stenOP15mo ago
@kian If it's a response object?
kian
kian15mo ago
Web API types like that can't be logged/stringified

Did you find this page helpful?