-
-
Notifications
You must be signed in to change notification settings - Fork 142
Closed
Labels
enhancementNew feature or requestNew feature or request
Description
It is a common practice to put possible errors in enum (or Sum Type).
So, we can later use them like so:
from enum import Enum, unique
@unique
class APIExceptions(Enum):
_value: Exception
ServerTimeoutError = exceptions.ServerTimeoutError
OtherError = exceptions.OtherError
def call_api() -> Result[int, APIExceptions]: ... We can also try Union and not enum.
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
enhancementNew feature or requestNew feature or request