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