TimeoutException doesn't have a type
to check what kind of timeout it was
#463
Labels
bug
Something isn't working
type
to check what kind of timeout it was
#463
Describe the bug
There are different types of timeout errors when running code. As described in the
TimeoutException
class:However, when catching one of these exceptions you have to parse the message to infer which of these it is. This is error-prone as you evolve the E2B SDK.
I need a way to check what kind of timeout to then decide what to do with it.
Currently, a sandbox Idle timeout message is:
While an execution timeout is "Execution timed out — the 'timeout' option can be used to increase this timeout"
To Reproduce
Steps to reproduce the behavior:
Set very short timeouts of the different kinds and see the TimeoutExceptions being thrown.
Expected behavior
A clear and concise description of what you expected to happen.
Should either raise different TimeoutException sub-classes, or the SandboxExceptions should have fields to make it easy to identify exactly what the issue was so the client can handle it properly without having to parse the message.
Additional context
E2B Py SDK v1.01
The text was updated successfully, but these errors were encountered: