Skip to content

crandas.errors

EngineError(message, code=EngineErrorCode.INTERNAL_SERVER_ERROR, http_code=None, instance=None, detail=None, parsed=None, **kwargs)

Bases: Exception

has_instance_type(cls)

Checks whether the error has an instance that is of the given type

InvalidServerResponse

Bases: RuntimeError

The client has received an invalid response from the server.

MergeError

Bases: ValueError

Exception raised when merging data.

Subclass of ValueError, equivalent to pandas.MergeError

ModelError

Bases: RuntimeError

Exception raised when an invalid operation is done from a ML/statistical model

SeriesEncodingError

Bases: RuntimeError

We could not encode the series correctly.

rethrow_as_fastapi_http_exception()

Context manager that rethrows any thrown exceptions as fastapi.HTTPException. The result has the following properties: - The status code of the HTTPException is the http code for an EngineError and 500 for any other exception. - The 'detail' is formatted as a dictionary with the following properties: * 'message': message of the exception. * 'traceback': traceback of the exception as a list of strings. * 'code' (for EngineError): code of the EngineError. * 'detail' (for EngineError): detail of the EngineError. In particular, the status code of EngineErrors is carried over to the HTTPException.