Skip to main content
Version: Main branch

exceptions

superduper.base.exceptions

Source code

AlreadyExists​

AlreadyExists(self,
obj_type: str,
obj_id: str)
ParameterDescription
obj_typethe type of the conflict resource (e.g Table, Job)
obj_idthe identifier of conflicting resource (e.g MyTable)

AlreadyExists means the resource you are creating already exists.

AppException​

AppException(self,
code: int,
reason: superduper.base.exceptions.StatusReason,
message: str)
ParameterDescription
codethe HTTP status code of the error (e.g 500)
reasonthe specific failure cause. (e.g Timeout, InternalError)
messagedetails about the reason (e.g read file XXX).

Generic exception for application-specific errors.

Should not be used directly. Only through the other classes.

BadRequest​

BadRequest(self,
message: str)
ParameterDescription
messagedetails about the exception

BadRequest means the request itself was invalid and makes no sense.

For example, deleting a read-only object.

Conflict​

Conflict(self,
obj_type: str,
obj_id: str,
details: str)
ParameterDescription
obj_typethe type of the conflict resource (e.g Table, Job)
obj_idthe identifier of conflicting resource (e.g MyTable)
detailsadditional information that indicate the nature of the conflict.

The request could not be completed due to a conflict with the current state of the target resource.

This code is used in situations where the user might be able to resolve the conflict and resubmit the request.

Forbidden​

Forbidden(self,
message: str)
ParameterDescription
messagedetails about the exception

The server understood the request but refuses to fulfill it.

If authentication credentials were provided in the request, the server considers them insufficient to grant access.

GenericServerResponse​

GenericServerResponse(self,
code: int,
server_message: str)
ParameterDescription
codethe http code we are interested to wrap.
server_messagethe payload of the http response

Raised for server responses that do not match any specific known error type.

It should only be used by REST clients that need to raise a local exception if they receive a non 200 (ok) request.

InternalError​

InternalError(self,
message: str,
cause: Exception | None = None)
ParameterDescription
messagedetails about the situation
causethe original exception (optional)

The server encountered an unexpected condition that prevented it from fulfilling the request.

InvalidResource​

InvalidResource(self,
message: str)
ParameterDescription
messagedetails about the exception

The request is valid, but the server was unable to process the contained instructions for the resource.

For example, to read the payload from an empty file.

NotFound​

NotFound(self,
obj_type: str,
obj_id: str)
ParameterDescription
obj_typethe type of the missing resource (e.g Table, Job)
obj_idthe identifier of the missing resource (e.g MyTable)

NotFound means one or more resources required for this operation could not be found.

TimeoutError​

TimeoutError(self,
message: str)
ParameterDescription
messagedetails about the exception

Timeout occurred before the request could be completed.

This is may be due to temporary server load or a transient communication issue with another server. Clients may retry, but the operation may still complete.

Unauthorized​

Unauthorized(self,
message: str)
ParameterDescription
messagedetails about the exception

The request has not been applied because it lacks valid authentication credentials for the target resource.