Skip to content
Reference of plugins_api 3.0.0.

plugins_api.exceptions

Plugin-related exceptions.

This module contains all exception classes related to plugin operations.

Attributes

NameDescription
SOURCE_ERRORSErrors that affect the whole source connection.

Classes

NameDescription
AuthenticationErrorException raised for authentication errors.
DataIntegrityErrorException raised for data integrity issues.
DataInvalidErrorException raised for invalid data objects.
DataNotFoundErrorException raised when a data object is not found.
DownloadDataErrorException raised for error during data download.
HostConnectionRefusedErrorException raised when the host is reachable but refuses the TCP connection.
InvalidPluginTypeErrorException raised for invalid plugin types.
PluginErrorBase class for exceptions related to plugins.
PluginNotFoundErrorException raised when a plugin is not found.
PluginPermissionErrorException raised for permission errors related to plugins.
PluginSubmissionErrorException raised for submission-related errors in plugins.
SizeLimitExceededErrorException raised when size or file count limits are exceeded.
UnreachableErrorException raised when a host is unreachable.

SOURCE_ERRORSattributemodule attribute#

SOURCE_ERRORS: tuple[type[PluginError], ...] = (UnreachableError, HostConnectionRefusedError, AuthenticationError)

Errors that affect the whole source connection.

In batch reads they must be raised, not stored per id. Shared by DataPlugin._read_each, madbot core, and plugins that implement a native batch override.

AuthenticationErrorclass#

class AuthenticationError(*args, **kwargs)

Bases: PluginError

Exception raised for authentication errors.

codeattributeinstance attribute#

code: str = 'invalid_credentials'

messageattributeinstance attribute#

message = 'Invalid username, password or token.'

parameterattributeinstance attribute#

parameter: str = 'credentials'

DataIntegrityErrorclass#

class DataIntegrityError(dataobject: str, *args, **kwargs)

Bases: PluginError

Exception raised for data integrity issues.

codeattributeinstance attribute#

code: str = 'data_integrity_error'

parameterattributeinstance attribute#

parameter: str = 'dataobject'

parameter_valueattributeinstance attribute#

parameter_value: str = dataobject

DataInvalidErrorclass#

class DataInvalidError(dataobject: str, *args, **kwargs)

Bases: PluginError

Exception raised for invalid data objects.

codeattributeinstance attribute#

code: str = 'invalid_dataobject'

parameterattributeinstance attribute#

parameter: str = 'dataobject'

parameter_valueattributeinstance attribute#

parameter_value: str = dataobject

DataNotFoundErrorclass#

class DataNotFoundError(dataobject: str, *args, **kwargs)

Bases: PluginError

Exception raised when a data object is not found.

codeattributeinstance attribute#

code: str = 'dataobject_not_found'

parameterattributeinstance attribute#

parameter: str = 'dataobject'

parameter_valueattributeinstance attribute#

parameter_value: str = dataobject

DownloadDataErrorclass#

class DownloadDataError(reason: str, *args, **kwargs)

Bases: PluginError

Exception raised for error during data download.

codeattributeinstance attribute#

code: str = 'download_data_error'

parameterattributeinstance attribute#

parameter: str = 'dataobject'

parameter_valueattributeinstance attribute#

parameter_value: str = reason

HostConnectionRefusedErrorclass#

class HostConnectionRefusedError(host: str, *args, **kwargs)

Bases: PluginError

Exception raised when the host is reachable but refuses the TCP connection.

Distinct from UnreachableError: the network path to the host works, but nothing accepted the connection (for example sshd down, wrong port, or an active reject). Plugins typically map errno.ECONNREFUSED to this.

codeattributeinstance attribute#

code: str = 'connection_refused'

parameterattributeinstance attribute#

parameter: str = 'hostname'

parameter_valueattributeinstance attribute#

parameter_value: str = host

InvalidPluginTypeErrorclass#

class InvalidPluginTypeError(plugin_type: str, *args, **kwargs)

Bases: PluginError

Exception raised for invalid plugin types.

This error is raised when an invalid plugin type is provided for a certain operation. For instance, when trying to retrieve the instance of a plugin that is not a ConnectionPlugin, as only ConnectionPlugins (and its subclasses) are allowed to be instantiated.

codeattributeinstance attribute#

code: str = 'invalid_plugin_type'

parameterattributeinstance attribute#

parameter: str = 'plugin_type'

parameter_valueattributeinstance attribute#

parameter_value: str = plugin_type

PluginErrorclass#

class PluginError(Exception)

Bases: Exception

Base class for exceptions related to plugins.

PluginNotFoundErrorclass#

class PluginNotFoundError(plugin: str, *args, **kwargs)

Bases: PluginError

Exception raised when a plugin is not found.

codeattributeinstance attribute#

code: str = 'plugin_not_found'

parameterattributeinstance attribute#

parameter: str = 'plugin'

parameter_valueattributeinstance attribute#

parameter_value: str = plugin

PluginPermissionErrorclass#

class PluginPermissionError(reason: str, *args, **kwargs)

Bases: PluginError

Exception raised for permission errors related to plugins.

codeattributeinstance attribute#

code: str = 'permission_error'

parameterattributeinstance attribute#

parameter: str = 'plugin'

parameter_valueattributeinstance attribute#

parameter_value: str = reason

PluginSubmissionErrorclass#

class PluginSubmissionError(reason: str, *args, **kwargs)

Bases: PluginError

Exception raised for submission-related errors in plugins.

codeattributeinstance attribute#

code: str = 'plugin_submission_error'

parameterattributeinstance attribute#

parameter: str = 'submission'

parameter_valueattributeinstance attribute#

parameter_value: str = reason

SizeLimitExceededErrorclass#

class SizeLimitExceededError(reason: str, *args, **kwargs)

Bases: PluginError

Exception raised when size or file count limits are exceeded.

codeattributeinstance attribute#

code: str = 'size_limit_exceeded'

parameterattributeinstance attribute#

parameter: str = 'submission'

parameter_valueattributeinstance attribute#

parameter_value: str = reason

UnreachableErrorclass#

class UnreachableError(host: str, *args, **kwargs)

Bases: PluginError

Exception raised when a host is unreachable.

codeattributeinstance attribute#

code: str = 'hostname_unreachable'

parameterattributeinstance attribute#

parameter: str = 'hostname'

parameter_valueattributeinstance attribute#

parameter_value: str = host