Error Handling
Exception classes and error handling utilities for the DASL client. These exceptions provide detailed information about various error conditions that can occur when interacting with DASL services.
- exception dasl_client.errors.errors.ConflictError(resource, identifier, message)[source]
Bases:
ExceptionSimple exception wrapper for 409 errors returned from the API
- Parameters:
resource (
str)identifier (
str)message (
str)
- exception dasl_client.errors.errors.NotFoundError(identifier, message)[source]
Bases:
ExceptionSimple exception wrapper for 404 errors returned from the API
- Parameters:
identifier (
str)message (
str)
- exception dasl_client.errors.errors.BadRequestError(message)[source]
Bases:
ExceptionSimple exception wrapper for 400 errors returned from the API
- Parameters:
message (
str)
- exception dasl_client.errors.errors.UnauthorizedError(message)[source]
Bases:
ExceptionSimple exception wrapper for 401 errors returned from the API
- Parameters:
message (
str)
- exception dasl_client.errors.errors.ForbiddenError(message)[source]
Bases:
ExceptionSimple exception wrapper for 403 errors returned from the API
- Parameters:
message (
str)
- dasl_client.errors.errors.handle_errors(f)[source]
A decorator that handles errors returned from the API.
- Parameters:
f (
Callable) – the function that could return an API error- Return type:
Callable- Returns:
The output from the callable ‘f’. If an Api error was raise, re-cast it to a library error before re-raising.
- dasl_client.errors.errors.error_handler()[source]
A context manager that handles errors returned from the API.
Within the context, if an API error is raised, it is re-cast to a library error before re-raising.
Error Handling Utilities
- dasl_client.errors.errors.error_handler()[source]
A context manager that handles errors returned from the API.
Within the context, if an API error is raised, it is re-cast to a library error before re-raising.
- dasl_client.errors.errors.handle_errors(f)[source]
A decorator that handles errors returned from the API.
- Parameters:
f (
Callable) – the function that could return an API error- Return type:
Callable- Returns:
The output from the callable ‘f’. If an Api error was raise, re-cast it to a library error before re-raising.