Serverless not returning error
The following code:
is returning the following logs:
5 Replies
The
error
key can only accept str
and not a list
or dict
.
Correct way of handling errors and causing the job to fail:
If the error is a string:
If its a list or dict:
You can also do something like this:
But the way you're doing it is incorrect.
@Justin Merrell can't this be fixed in SDK? More and more people are having this issue, including me.I'll take a look, I thought I was just converting any error into a string as of now.
Oh maybe it does, I haven't checked out the latest SDK version, but it was an issue for me.
your fix worked @ashleyk thank you! not sure why my docker file bundled an old runpod version - the same code runs on a different serverless endpoint
Probably running an older SDK version, at some point returning a list for
error
worked but then somewhere along the line it stopped working.