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
kian13mo ago
If it's an Error object then JSON.stringify alone doesn't work on them
sten
stenOP13mo ago
@kian If it's a response object?
kian
kian13mo ago
Web API types like that can't be logged/stringified
Want results from more Discord servers?
Add your server