Exceptions¶
aana.exceptions
¶
BaseException
¶
Bases: Exception
Base class for SDK exceptions.
Source code in aana/exceptions/core.py
get_data
¶
Get the data to be returned to the client.
RETURNS | DESCRIPTION |
---|---|
dict[str, Any]
|
Dict[str, Any]: data to be returned to the client |
add_extra
¶
Add extra data to the exception.
This data will be returned to the user as part of the response.
How to use: in the exception handler, add the extra data to the exception and raise it again.
PARAMETER | DESCRIPTION |
---|---|
data |
dictionary containing the extra data
TYPE:
|
Source code in aana/exceptions/core.py
aana.exceptions.runtime
¶
InferenceException
¶
Bases: BaseException
Exception raised when there is an error during inference.
PARAMETER | DESCRIPTION |
---|---|
model_name |
name of the model that caused the exception
TYPE:
|
message |
the message to display
TYPE:
|
Source code in aana/exceptions/runtime.py
get_data
¶
Get the data to be returned to the client.
RETURNS | DESCRIPTION |
---|---|
dict[str, Any]
|
Dict[str, Any]: data to be returned to the client |
add_extra
¶
Add extra data to the exception.
This data will be returned to the user as part of the response.
How to use: in the exception handler, add the extra data to the exception and raise it again.
PARAMETER | DESCRIPTION |
---|---|
data |
dictionary containing the extra data
TYPE:
|
Source code in aana/exceptions/core.py
PromptTooLongException
¶
Bases: BaseException
Exception raised when the prompt is too long.
ATTRIBUTE | DESCRIPTION |
---|---|
prompt_len |
the length of the prompt in tokens
TYPE:
|
max_len |
the maximum allowed length of the prompt in tokens
TYPE:
|
PARAMETER | DESCRIPTION |
---|---|
prompt_len |
the length of the prompt in tokens
TYPE:
|
max_len |
the maximum allowed length of the prompt in tokens
TYPE:
|
Source code in aana/exceptions/runtime.py
get_data
¶
Get the data to be returned to the client.
RETURNS | DESCRIPTION |
---|---|
dict[str, Any]
|
Dict[str, Any]: data to be returned to the client |
add_extra
¶
Add extra data to the exception.
This data will be returned to the user as part of the response.
How to use: in the exception handler, add the extra data to the exception and raise it again.
PARAMETER | DESCRIPTION |
---|---|
data |
dictionary containing the extra data
TYPE:
|
Source code in aana/exceptions/core.py
EndpointNotFoundException
¶
Bases: BaseException
Exception raised when an endpoint is not found.
ATTRIBUTE | DESCRIPTION |
---|---|
target |
the name of the target deployment
TYPE:
|
endpoint |
the endpoint path
TYPE:
|
PARAMETER | DESCRIPTION |
---|---|
target |
the name of the target deployment
TYPE:
|
endpoint |
the endpoint path
TYPE:
|
Source code in aana/exceptions/runtime.py
get_data
¶
Get the data to be returned to the client.
RETURNS | DESCRIPTION |
---|---|
dict[str, Any]
|
Dict[str, Any]: data to be returned to the client |
add_extra
¶
Add extra data to the exception.
This data will be returned to the user as part of the response.
How to use: in the exception handler, add the extra data to the exception and raise it again.
PARAMETER | DESCRIPTION |
---|---|
data |
dictionary containing the extra data
TYPE:
|
Source code in aana/exceptions/core.py
TooManyRequestsException
¶
Bases: BaseException
Exception raised when calling a rate-limited resource too often.
ATTRIBUTE | DESCRIPTION |
---|---|
rate_limit |
The limit amount.
TYPE:
|
rate_duration |
The duration for the limit in seconds.
TYPE:
|
PARAMETER | DESCRIPTION |
---|---|
rate_limit |
The limit amount.
TYPE:
|
rate_duration |
The duration for the limit in seconds.
TYPE:
|
Source code in aana/exceptions/runtime.py
get_data
¶
Get the data to be returned to the client.
RETURNS | DESCRIPTION |
---|---|
dict[str, Any]
|
Dict[str, Any]: data to be returned to the client |
add_extra
¶
Add extra data to the exception.
This data will be returned to the user as part of the response.
How to use: in the exception handler, add the extra data to the exception and raise it again.
PARAMETER | DESCRIPTION |
---|---|
data |
dictionary containing the extra data
TYPE:
|
Source code in aana/exceptions/core.py
HandlerAlreadyRegisteredException
¶
Bases: BaseException
Exception raised when registering a handler that is already registered.
Source code in aana/exceptions/runtime.py
get_data
¶
Get the data to be returned to the client.
RETURNS | DESCRIPTION |
---|---|
dict[str, Any]
|
Dict[str, Any]: data to be returned to the client |
add_extra
¶
Add extra data to the exception.
This data will be returned to the user as part of the response.
How to use: in the exception handler, add the extra data to the exception and raise it again.
PARAMETER | DESCRIPTION |
---|---|
data |
dictionary containing the extra data
TYPE:
|
Source code in aana/exceptions/core.py
HandlerNotRegisteredException
¶
Bases: BaseException
Exception removing a handler that has not been registered.
Source code in aana/exceptions/runtime.py
get_data
¶
Get the data to be returned to the client.
RETURNS | DESCRIPTION |
---|---|
dict[str, Any]
|
Dict[str, Any]: data to be returned to the client |
add_extra
¶
Add extra data to the exception.
This data will be returned to the user as part of the response.
How to use: in the exception handler, add the extra data to the exception and raise it again.
PARAMETER | DESCRIPTION |
---|---|
data |
dictionary containing the extra data
TYPE:
|
Source code in aana/exceptions/core.py
EmptyMigrationsException
¶
Bases: BaseException
Exception raised when there are no migrations to apply.
Source code in aana/exceptions/core.py
get_data
¶
Get the data to be returned to the client.
RETURNS | DESCRIPTION |
---|---|
dict[str, Any]
|
Dict[str, Any]: data to be returned to the client |
add_extra
¶
Add extra data to the exception.
This data will be returned to the user as part of the response.
How to use: in the exception handler, add the extra data to the exception and raise it again.
PARAMETER | DESCRIPTION |
---|---|
data |
dictionary containing the extra data
TYPE:
|
Source code in aana/exceptions/core.py
DeploymentException
¶
Bases: Exception
Base exception for deployment errors.
InsufficientResources
¶
Bases: DeploymentException
Exception raised when there are insufficient resources for a deployment.
FailedDeployment
¶
Bases: DeploymentException
Exception raised when there is an error during deployment.
UploadedFileNotFound
¶
Bases: Exception
Exception raised when the uploaded file is not found.
PARAMETER | DESCRIPTION |
---|---|
filename |
the name of the file that was not found
TYPE:
|
Source code in aana/exceptions/runtime.py
InvalidWebhookEventType
¶
Bases: BaseException
Exception raised when an invalid webhook event type is provided.
PARAMETER | DESCRIPTION |
---|---|
event_type |
the invalid event type
TYPE:
|
Source code in aana/exceptions/runtime.py
get_data
¶
Get the data to be returned to the client.
RETURNS | DESCRIPTION |
---|---|
dict[str, Any]
|
Dict[str, Any]: data to be returned to the client |
add_extra
¶
Add extra data to the exception.
This data will be returned to the user as part of the response.
How to use: in the exception handler, add the extra data to the exception and raise it again.
PARAMETER | DESCRIPTION |
---|---|
data |
dictionary containing the extra data
TYPE:
|
Source code in aana/exceptions/core.py
aana.exceptions.io
¶
ImageReadingException
¶
Bases: BaseException
Exception raised when there is an error reading an image.
ATTRIBUTE | DESCRIPTION |
---|---|
image |
the image that caused the exception
TYPE:
|
PARAMETER | DESCRIPTION |
---|---|
image |
the image that caused the exception
TYPE:
|
Source code in aana/exceptions/io.py
get_data
¶
Get the data to be returned to the client.
RETURNS | DESCRIPTION |
---|---|
dict[str, Any]
|
Dict[str, Any]: data to be returned to the client |
add_extra
¶
Add extra data to the exception.
This data will be returned to the user as part of the response.
How to use: in the exception handler, add the extra data to the exception and raise it again.
PARAMETER | DESCRIPTION |
---|---|
data |
dictionary containing the extra data
TYPE:
|
Source code in aana/exceptions/core.py
AudioReadingException
¶
Bases: BaseException
Exception raised when there is an error reading an audio.
ATTRIBUTE | DESCRIPTION |
---|---|
audio |
the audio that caused the exception
TYPE:
|
PARAMETER | DESCRIPTION |
---|---|
audio |
the audio that caused the exception
TYPE:
|
Source code in aana/exceptions/io.py
get_data
¶
Get the data to be returned to the client.
RETURNS | DESCRIPTION |
---|---|
dict[str, Any]
|
Dict[str, Any]: data to be returned to the client |
add_extra
¶
Add extra data to the exception.
This data will be returned to the user as part of the response.
How to use: in the exception handler, add the extra data to the exception and raise it again.
PARAMETER | DESCRIPTION |
---|---|
data |
dictionary containing the extra data
TYPE:
|
Source code in aana/exceptions/core.py
DownloadException
¶
Bases: BaseException
Exception raised when there is an error downloading a file.
ATTRIBUTE | DESCRIPTION |
---|---|
url |
the URL of the file that caused the exception
TYPE:
|
PARAMETER | DESCRIPTION |
---|---|
url |
the URL of the file that caused the exception
TYPE:
|
msg |
the error message
TYPE:
|
Source code in aana/exceptions/io.py
get_data
¶
Get the data to be returned to the client.
RETURNS | DESCRIPTION |
---|---|
dict[str, Any]
|
Dict[str, Any]: data to be returned to the client |
add_extra
¶
Add extra data to the exception.
This data will be returned to the user as part of the response.
How to use: in the exception handler, add the extra data to the exception and raise it again.
PARAMETER | DESCRIPTION |
---|---|
data |
dictionary containing the extra data
TYPE:
|
Source code in aana/exceptions/core.py
VideoException
¶
Bases: BaseException
Exception raised when working with videos.
ATTRIBUTE | DESCRIPTION |
---|---|
video |
the video that caused the exception
TYPE:
|
PARAMETER | DESCRIPTION |
---|---|
video |
the video that caused the exception
TYPE:
|
Source code in aana/exceptions/io.py
get_data
¶
Get the data to be returned to the client.
RETURNS | DESCRIPTION |
---|---|
dict[str, Any]
|
Dict[str, Any]: data to be returned to the client |
add_extra
¶
Add extra data to the exception.
This data will be returned to the user as part of the response.
How to use: in the exception handler, add the extra data to the exception and raise it again.
PARAMETER | DESCRIPTION |
---|---|
data |
dictionary containing the extra data
TYPE:
|
Source code in aana/exceptions/core.py
VideoReadingException
¶
Bases: VideoException
Exception raised when there is an error reading a video.
ATTRIBUTE | DESCRIPTION |
---|---|
video |
the video that caused the exception
TYPE:
|
PARAMETER | DESCRIPTION |
---|---|
video |
the video that caused the exception
TYPE:
|
Source code in aana/exceptions/io.py
get_data
¶
Get the data to be returned to the client.
RETURNS | DESCRIPTION |
---|---|
dict[str, Any]
|
Dict[str, Any]: data to be returned to the client |
add_extra
¶
Add extra data to the exception.
This data will be returned to the user as part of the response.
How to use: in the exception handler, add the extra data to the exception and raise it again.
PARAMETER | DESCRIPTION |
---|---|
data |
dictionary containing the extra data
TYPE:
|
Source code in aana/exceptions/core.py
VideoTooLongException
¶
Bases: BaseException
Exception raised when the video is too long.
ATTRIBUTE | DESCRIPTION |
---|---|
video |
the video that caused the exception
TYPE:
|
video_len |
the length of the video in seconds
TYPE:
|
max_len |
the maximum allowed length of the video in seconds
TYPE:
|
PARAMETER | DESCRIPTION |
---|---|
video |
the video that caused the exception
TYPE:
|
video_len |
the length of the video in seconds
TYPE:
|
max_len |
the maximum allowed length of the video in seconds
TYPE:
|
Source code in aana/exceptions/io.py
get_data
¶
Get the data to be returned to the client.
RETURNS | DESCRIPTION |
---|---|
dict[str, Any]
|
Dict[str, Any]: data to be returned to the client |
add_extra
¶
Add extra data to the exception.
This data will be returned to the user as part of the response.
How to use: in the exception handler, add the extra data to the exception and raise it again.
PARAMETER | DESCRIPTION |
---|---|
data |
dictionary containing the extra data
TYPE:
|
Source code in aana/exceptions/core.py
aana.exceptions.db
¶
NotFoundException
¶
Bases: BaseException
Raised when an item searched by id is not found.
PARAMETER | DESCRIPTION |
---|---|
table_name |
the name of the table being queried.
TYPE:
|
id |
the id of the item to be retrieved.
TYPE:
|
Source code in aana/exceptions/db.py
get_data
¶
Get the data to be returned to the client.
RETURNS | DESCRIPTION |
---|---|
dict[str, Any]
|
Dict[str, Any]: data to be returned to the client |
add_extra
¶
Add extra data to the exception.
This data will be returned to the user as part of the response.
How to use: in the exception handler, add the extra data to the exception and raise it again.
PARAMETER | DESCRIPTION |
---|---|
data |
dictionary containing the extra data
TYPE:
|
Source code in aana/exceptions/core.py
MediaIdAlreadyExistsException
¶
Bases: BaseException
Raised when a media_id already exists.
PARAMETER | DESCRIPTION |
---|---|
table_name |
the name of the table being queried.
TYPE:
|
media_id |
the id of the item to be retrieved.
TYPE:
|
Source code in aana/exceptions/db.py
get_data
¶
Get the data to be returned to the client.
RETURNS | DESCRIPTION |
---|---|
dict[str, Any]
|
Dict[str, Any]: data to be returned to the client |
add_extra
¶
Add extra data to the exception.
This data will be returned to the user as part of the response.
How to use: in the exception handler, add the extra data to the exception and raise it again.
PARAMETER | DESCRIPTION |
---|---|
data |
dictionary containing the extra data
TYPE:
|