benchling_sdk.errors module¶
Specialized Exception classes.
- exception BenchlingError¶
Bases:
Exception
An error resulting from communicating with the Benchling API.
This could be an error returned from the API intentionally (e.g., 400 Bad Request) or an unexpected transport error (e.g., 502 Bad Gateway)
The json attribute is present if the API response provided a deserializable JSON body as part of the error description. It will be None if the response could not be parsed as JSON.
The content attribute is any unparsed content returned as part of the response body.
- __init__(status_code: int, headers: MutableMapping[str, str], json: Optional[Dict[str, str]], content: Optional[bytes], parsed: Union[None, ForbiddenError, NotFoundError, BadRequestError, BadRequestErrorBulk, ConflictError]) None ¶
- classmethod from_response(response: benchling_api_client.v2.types.Response) BenchlingError ¶
Create a BenchlingError from a generated Response.
- parsed: Union[None, ForbiddenError, NotFoundError, BadRequestError, BadRequestErrorBulk, ConflictError]¶
- exception RegistrationError¶
Bases:
Exception
An error relating to Benchling registration.
- __init__(message: Optional[str] = None, errors: Optional[Dict[Any, Any]] = None, task_status: Optional[AsyncTaskStatus] = None) None ¶
- errors: Optional[Dict[Any, Any]] = None¶
- classmethod from_task(task: AsyncTask) RegistrationError ¶
Create a RegistrationError from a failed AsyncTask.
- task_status: Optional[AsyncTaskStatus] = None¶