# plugins_api.exceptions

*module*

Plugin-related exceptions.

This module contains all exception classes related to plugin operations.

[View source](https://gitlab.com/ifb-elixirfr/madbot/madbot/-/blob/3aa4c278bf4620ccd23a16eb233b035646016bd2/plugin_api/plugins_api/exceptions.py#L1-1)

## plugins_api.exceptions.SOURCE_ERRORS

*attribute* · *module attribute*

```python
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.

[View source](https://gitlab.com/ifb-elixirfr/madbot/madbot/-/blob/3aa4c278bf4620ccd23a16eb233b035646016bd2/plugin_api/plugins_api/exceptions.py#L141-145)

## plugins_api.exceptions.AuthenticationError

*class*

```python
class AuthenticationError(PluginError)
```

Bases: `plugins_api.exceptions.PluginError`

Exception raised for authentication errors.

[View source](https://gitlab.com/ifb-elixirfr/madbot/madbot/-/blob/3aa4c278bf4620ccd23a16eb233b035646016bd2/plugin_api/plugins_api/exceptions.py#L61-69)

### plugins_api.exceptions.AuthenticationError.code

*attribute* · *instance attribute*

```python
code: str = 'invalid_credentials'
```

[View source](https://gitlab.com/ifb-elixirfr/madbot/madbot/-/blob/3aa4c278bf4620ccd23a16eb233b035646016bd2/plugin_api/plugins_api/exceptions.py#L66-66)

### plugins_api.exceptions.AuthenticationError.message

*attribute* · *instance attribute*

```python
message = 'Invalid username, password or token.'
```

[View source](https://gitlab.com/ifb-elixirfr/madbot/madbot/-/blob/3aa4c278bf4620ccd23a16eb233b035646016bd2/plugin_api/plugins_api/exceptions.py#L68-68)

### plugins_api.exceptions.AuthenticationError.parameter

*attribute* · *instance attribute*

```python
parameter: str = 'credentials'
```

[View source](https://gitlab.com/ifb-elixirfr/madbot/madbot/-/blob/3aa4c278bf4620ccd23a16eb233b035646016bd2/plugin_api/plugins_api/exceptions.py#L67-67)

## plugins_api.exceptions.DataIntegrityError

*class*

```python
class DataIntegrityError(PluginError)
```

Bases: `plugins_api.exceptions.PluginError`

Exception raised for data integrity issues.

[View source](https://gitlab.com/ifb-elixirfr/madbot/madbot/-/blob/3aa4c278bf4620ccd23a16eb233b035646016bd2/plugin_api/plugins_api/exceptions.py#L275-301)

### plugins_api.exceptions.DataIntegrityError.code

*attribute* · *instance attribute*

```python
code: str = 'data_integrity_error'
```

[View source](https://gitlab.com/ifb-elixirfr/madbot/madbot/-/blob/3aa4c278bf4620ccd23a16eb233b035646016bd2/plugin_api/plugins_api/exceptions.py#L288-288)

### plugins_api.exceptions.DataIntegrityError.parameter

*attribute* · *instance attribute*

```python
parameter: str = 'dataobject'
```

[View source](https://gitlab.com/ifb-elixirfr/madbot/madbot/-/blob/3aa4c278bf4620ccd23a16eb233b035646016bd2/plugin_api/plugins_api/exceptions.py#L289-289)

### plugins_api.exceptions.DataIntegrityError.parameter_value

*attribute* · *instance attribute*

```python
parameter_value: str = dataobject
```

[View source](https://gitlab.com/ifb-elixirfr/madbot/madbot/-/blob/3aa4c278bf4620ccd23a16eb233b035646016bd2/plugin_api/plugins_api/exceptions.py#L290-290)

## plugins_api.exceptions.DataInvalidError

*class*

```python
class DataInvalidError(PluginError)
```

Bases: `plugins_api.exceptions.PluginError`

Exception raised for invalid data objects.

[View source](https://gitlab.com/ifb-elixirfr/madbot/madbot/-/blob/3aa4c278bf4620ccd23a16eb233b035646016bd2/plugin_api/plugins_api/exceptions.py#L185-212)

### plugins_api.exceptions.DataInvalidError.code

*attribute* · *instance attribute*

```python
code: str = 'invalid_dataobject'
```

[View source](https://gitlab.com/ifb-elixirfr/madbot/madbot/-/blob/3aa4c278bf4620ccd23a16eb233b035646016bd2/plugin_api/plugins_api/exceptions.py#L198-198)

### plugins_api.exceptions.DataInvalidError.parameter

*attribute* · *instance attribute*

```python
parameter: str = 'dataobject'
```

[View source](https://gitlab.com/ifb-elixirfr/madbot/madbot/-/blob/3aa4c278bf4620ccd23a16eb233b035646016bd2/plugin_api/plugins_api/exceptions.py#L199-199)

### plugins_api.exceptions.DataInvalidError.parameter_value

*attribute* · *instance attribute*

```python
parameter_value: str = dataobject
```

[View source](https://gitlab.com/ifb-elixirfr/madbot/madbot/-/blob/3aa4c278bf4620ccd23a16eb233b035646016bd2/plugin_api/plugins_api/exceptions.py#L200-200)

## plugins_api.exceptions.DataNotFoundError

*class*

```python
class DataNotFoundError(PluginError)
```

Bases: `plugins_api.exceptions.PluginError`

Exception raised when a data object is not found.

[View source](https://gitlab.com/ifb-elixirfr/madbot/madbot/-/blob/3aa4c278bf4620ccd23a16eb233b035646016bd2/plugin_api/plugins_api/exceptions.py#L155-182)

### plugins_api.exceptions.DataNotFoundError.code

*attribute* · *instance attribute*

```python
code: str = 'dataobject_not_found'
```

[View source](https://gitlab.com/ifb-elixirfr/madbot/madbot/-/blob/3aa4c278bf4620ccd23a16eb233b035646016bd2/plugin_api/plugins_api/exceptions.py#L168-168)

### plugins_api.exceptions.DataNotFoundError.parameter

*attribute* · *instance attribute*

```python
parameter: str = 'dataobject'
```

[View source](https://gitlab.com/ifb-elixirfr/madbot/madbot/-/blob/3aa4c278bf4620ccd23a16eb233b035646016bd2/plugin_api/plugins_api/exceptions.py#L169-169)

### plugins_api.exceptions.DataNotFoundError.parameter_value

*attribute* · *instance attribute*

```python
parameter_value: str = dataobject
```

[View source](https://gitlab.com/ifb-elixirfr/madbot/madbot/-/blob/3aa4c278bf4620ccd23a16eb233b035646016bd2/plugin_api/plugins_api/exceptions.py#L170-170)

## plugins_api.exceptions.DownloadDataError

*class*

```python
class DownloadDataError(PluginError)
```

Bases: `plugins_api.exceptions.PluginError`

Exception raised for error during data download.

[View source](https://gitlab.com/ifb-elixirfr/madbot/madbot/-/blob/3aa4c278bf4620ccd23a16eb233b035646016bd2/plugin_api/plugins_api/exceptions.py#L245-272)

### plugins_api.exceptions.DownloadDataError.code

*attribute* · *instance attribute*

```python
code: str = 'download_data_error'
```

[View source](https://gitlab.com/ifb-elixirfr/madbot/madbot/-/blob/3aa4c278bf4620ccd23a16eb233b035646016bd2/plugin_api/plugins_api/exceptions.py#L258-258)

### plugins_api.exceptions.DownloadDataError.parameter

*attribute* · *instance attribute*

```python
parameter: str = 'dataobject'
```

[View source](https://gitlab.com/ifb-elixirfr/madbot/madbot/-/blob/3aa4c278bf4620ccd23a16eb233b035646016bd2/plugin_api/plugins_api/exceptions.py#L259-259)

### plugins_api.exceptions.DownloadDataError.parameter_value

*attribute* · *instance attribute*

```python
parameter_value: str = reason
```

[View source](https://gitlab.com/ifb-elixirfr/madbot/madbot/-/blob/3aa4c278bf4620ccd23a16eb233b035646016bd2/plugin_api/plugins_api/exceptions.py#L260-260)

## plugins_api.exceptions.HostConnectionRefusedError

*class*

```python
class HostConnectionRefusedError(PluginError)
```

Bases: `plugins_api.exceptions.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.

[View source](https://gitlab.com/ifb-elixirfr/madbot/madbot/-/blob/3aa4c278bf4620ccd23a16eb233b035646016bd2/plugin_api/plugins_api/exceptions.py#L102-138)

### plugins_api.exceptions.HostConnectionRefusedError.code

*attribute* · *instance attribute*

```python
code: str = 'connection_refused'
```

[View source](https://gitlab.com/ifb-elixirfr/madbot/madbot/-/blob/3aa4c278bf4620ccd23a16eb233b035646016bd2/plugin_api/plugins_api/exceptions.py#L121-121)

### plugins_api.exceptions.HostConnectionRefusedError.parameter

*attribute* · *instance attribute*

```python
parameter: str = 'hostname'
```

[View source](https://gitlab.com/ifb-elixirfr/madbot/madbot/-/blob/3aa4c278bf4620ccd23a16eb233b035646016bd2/plugin_api/plugins_api/exceptions.py#L122-122)

### plugins_api.exceptions.HostConnectionRefusedError.parameter_value

*attribute* · *instance attribute*

```python
parameter_value: str = host
```

[View source](https://gitlab.com/ifb-elixirfr/madbot/madbot/-/blob/3aa4c278bf4620ccd23a16eb233b035646016bd2/plugin_api/plugins_api/exceptions.py#L123-123)

## plugins_api.exceptions.InvalidPluginTypeError

*class*

```python
class InvalidPluginTypeError(PluginError)
```

Bases: `plugins_api.exceptions.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.

[View source](https://gitlab.com/ifb-elixirfr/madbot/madbot/-/blob/3aa4c278bf4620ccd23a16eb233b035646016bd2/plugin_api/plugins_api/exceptions.py#L304-337)

### plugins_api.exceptions.InvalidPluginTypeError.code

*attribute* · *instance attribute*

```python
code: str = 'invalid_plugin_type'
```

[View source](https://gitlab.com/ifb-elixirfr/madbot/madbot/-/blob/3aa4c278bf4620ccd23a16eb233b035646016bd2/plugin_api/plugins_api/exceptions.py#L323-323)

### plugins_api.exceptions.InvalidPluginTypeError.parameter

*attribute* · *instance attribute*

```python
parameter: str = 'plugin_type'
```

[View source](https://gitlab.com/ifb-elixirfr/madbot/madbot/-/blob/3aa4c278bf4620ccd23a16eb233b035646016bd2/plugin_api/plugins_api/exceptions.py#L324-324)

### plugins_api.exceptions.InvalidPluginTypeError.parameter_value

*attribute* · *instance attribute*

```python
parameter_value: str = plugin_type
```

[View source](https://gitlab.com/ifb-elixirfr/madbot/madbot/-/blob/3aa4c278bf4620ccd23a16eb233b035646016bd2/plugin_api/plugins_api/exceptions.py#L325-325)

## plugins_api.exceptions.PluginError

*class*

```python
class PluginError(Exception)
```

Bases: `Exception`

Base class for exceptions related to plugins.

[View source](https://gitlab.com/ifb-elixirfr/madbot/madbot/-/blob/3aa4c278bf4620ccd23a16eb233b035646016bd2/plugin_api/plugins_api/exceptions.py#L25-28)

## plugins_api.exceptions.PluginNotFoundError

*class*

```python
class PluginNotFoundError(PluginError)
```

Bases: `plugins_api.exceptions.PluginError`

Exception raised when a plugin is not found.

[View source](https://gitlab.com/ifb-elixirfr/madbot/madbot/-/blob/3aa4c278bf4620ccd23a16eb233b035646016bd2/plugin_api/plugins_api/exceptions.py#L31-58)

### plugins_api.exceptions.PluginNotFoundError.code

*attribute* · *instance attribute*

```python
code: str = 'plugin_not_found'
```

[View source](https://gitlab.com/ifb-elixirfr/madbot/madbot/-/blob/3aa4c278bf4620ccd23a16eb233b035646016bd2/plugin_api/plugins_api/exceptions.py#L44-44)

### plugins_api.exceptions.PluginNotFoundError.parameter

*attribute* · *instance attribute*

```python
parameter: str = 'plugin'
```

[View source](https://gitlab.com/ifb-elixirfr/madbot/madbot/-/blob/3aa4c278bf4620ccd23a16eb233b035646016bd2/plugin_api/plugins_api/exceptions.py#L45-45)

### plugins_api.exceptions.PluginNotFoundError.parameter_value

*attribute* · *instance attribute*

```python
parameter_value: str = plugin
```

[View source](https://gitlab.com/ifb-elixirfr/madbot/madbot/-/blob/3aa4c278bf4620ccd23a16eb233b035646016bd2/plugin_api/plugins_api/exceptions.py#L46-46)

## plugins_api.exceptions.PluginPermissionError

*class*

```python
class PluginPermissionError(PluginError)
```

Bases: `plugins_api.exceptions.PluginError`

Exception raised for permission errors related to plugins.

[View source](https://gitlab.com/ifb-elixirfr/madbot/madbot/-/blob/3aa4c278bf4620ccd23a16eb233b035646016bd2/plugin_api/plugins_api/exceptions.py#L215-242)

### plugins_api.exceptions.PluginPermissionError.code

*attribute* · *instance attribute*

```python
code: str = 'permission_error'
```

[View source](https://gitlab.com/ifb-elixirfr/madbot/madbot/-/blob/3aa4c278bf4620ccd23a16eb233b035646016bd2/plugin_api/plugins_api/exceptions.py#L228-228)

### plugins_api.exceptions.PluginPermissionError.parameter

*attribute* · *instance attribute*

```python
parameter: str = 'plugin'
```

[View source](https://gitlab.com/ifb-elixirfr/madbot/madbot/-/blob/3aa4c278bf4620ccd23a16eb233b035646016bd2/plugin_api/plugins_api/exceptions.py#L229-229)

### plugins_api.exceptions.PluginPermissionError.parameter_value

*attribute* · *instance attribute*

```python
parameter_value: str = reason
```

[View source](https://gitlab.com/ifb-elixirfr/madbot/madbot/-/blob/3aa4c278bf4620ccd23a16eb233b035646016bd2/plugin_api/plugins_api/exceptions.py#L230-230)

## plugins_api.exceptions.PluginSubmissionError

*class*

```python
class PluginSubmissionError(PluginError)
```

Bases: `plugins_api.exceptions.PluginError`

Exception raised for submission-related errors in plugins.

[View source](https://gitlab.com/ifb-elixirfr/madbot/madbot/-/blob/3aa4c278bf4620ccd23a16eb233b035646016bd2/plugin_api/plugins_api/exceptions.py#L340-367)

### plugins_api.exceptions.PluginSubmissionError.code

*attribute* · *instance attribute*

```python
code: str = 'plugin_submission_error'
```

[View source](https://gitlab.com/ifb-elixirfr/madbot/madbot/-/blob/3aa4c278bf4620ccd23a16eb233b035646016bd2/plugin_api/plugins_api/exceptions.py#L353-353)

### plugins_api.exceptions.PluginSubmissionError.parameter

*attribute* · *instance attribute*

```python
parameter: str = 'submission'
```

[View source](https://gitlab.com/ifb-elixirfr/madbot/madbot/-/blob/3aa4c278bf4620ccd23a16eb233b035646016bd2/plugin_api/plugins_api/exceptions.py#L354-354)

### plugins_api.exceptions.PluginSubmissionError.parameter_value

*attribute* · *instance attribute*

```python
parameter_value: str = reason
```

[View source](https://gitlab.com/ifb-elixirfr/madbot/madbot/-/blob/3aa4c278bf4620ccd23a16eb233b035646016bd2/plugin_api/plugins_api/exceptions.py#L355-355)

## plugins_api.exceptions.SizeLimitExceededError

*class*

```python
class SizeLimitExceededError(PluginError)
```

Bases: `plugins_api.exceptions.PluginError`

Exception raised when size or file count limits are exceeded.

[View source](https://gitlab.com/ifb-elixirfr/madbot/madbot/-/blob/3aa4c278bf4620ccd23a16eb233b035646016bd2/plugin_api/plugins_api/exceptions.py#L370-396)

### plugins_api.exceptions.SizeLimitExceededError.code

*attribute* · *instance attribute*

```python
code: str = 'size_limit_exceeded'
```

[View source](https://gitlab.com/ifb-elixirfr/madbot/madbot/-/blob/3aa4c278bf4620ccd23a16eb233b035646016bd2/plugin_api/plugins_api/exceptions.py#L382-382)

### plugins_api.exceptions.SizeLimitExceededError.parameter

*attribute* · *instance attribute*

```python
parameter: str = 'submission'
```

[View source](https://gitlab.com/ifb-elixirfr/madbot/madbot/-/blob/3aa4c278bf4620ccd23a16eb233b035646016bd2/plugin_api/plugins_api/exceptions.py#L383-383)

### plugins_api.exceptions.SizeLimitExceededError.parameter_value

*attribute* · *instance attribute*

```python
parameter_value: str = reason
```

[View source](https://gitlab.com/ifb-elixirfr/madbot/madbot/-/blob/3aa4c278bf4620ccd23a16eb233b035646016bd2/plugin_api/plugins_api/exceptions.py#L384-384)

## plugins_api.exceptions.UnreachableError

*class*

```python
class UnreachableError(PluginError)
```

Bases: `plugins_api.exceptions.PluginError`

Exception raised when a host is unreachable.

[View source](https://gitlab.com/ifb-elixirfr/madbot/madbot/-/blob/3aa4c278bf4620ccd23a16eb233b035646016bd2/plugin_api/plugins_api/exceptions.py#L72-99)

### plugins_api.exceptions.UnreachableError.code

*attribute* · *instance attribute*

```python
code: str = 'hostname_unreachable'
```

[View source](https://gitlab.com/ifb-elixirfr/madbot/madbot/-/blob/3aa4c278bf4620ccd23a16eb233b035646016bd2/plugin_api/plugins_api/exceptions.py#L85-85)

### plugins_api.exceptions.UnreachableError.parameter

*attribute* · *instance attribute*

```python
parameter: str = 'hostname'
```

[View source](https://gitlab.com/ifb-elixirfr/madbot/madbot/-/blob/3aa4c278bf4620ccd23a16eb233b035646016bd2/plugin_api/plugins_api/exceptions.py#L86-86)

### plugins_api.exceptions.UnreachableError.parameter_value

*attribute* · *instance attribute*

```python
parameter_value: str = host
```

[View source](https://gitlab.com/ifb-elixirfr/madbot/madbot/-/blob/3aa4c278bf4620ccd23a16eb233b035646016bd2/plugin_api/plugins_api/exceptions.py#L87-87)
