> For the complete documentation index, see [llms.txt](https://docs.minorin.io/enma/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.minorin.io/enma/documentation/errors.md).

# Errors

While using the library, you might encounter some specific errors. Here's a description of each:

## InstanceError

* **Description:** Raised when an instance of an object is not of the expected type.&#x20;
* **Common Cause:** Trying to add a source that isn't an instance of IMangaRepository.
* **Code**:  INSTANCE\_ERROR

## SourceNotAvailable

* **Description:** Raised when attempting to access a source that isn't available in the defined source list.&#x20;
* **Common Cause:** Trying to set a source that hasn't been previously added.
* **Code:** SOURCE\_NOT\_AVAILABLE

## SourceWasNotDefined

* **Description:** Raised when trying to perform an action (like fetching a manga) without first defining a source.&#x20;
* **Common Cause:** Forgetting to set the source before performing an operation.
* **Code**: SOURCE\_WAS\_NOT\_DEFINED

## ExceedRetryCount

* **Description:** Specific to the NHentai adapter. Raised when the random method fails to fetch a random doujin after several attempts.&#x20;
* **Common Cause**: Consecutive failures when trying to fetch a random doujin from NHentai.&#x20;
* **Code**: EXCEED\_RETRY\_COUNT

## NHentaiSourceWithoutConfig

* **Description:** Raised when trying to make a request to NHentai without providing the necessary configurations.
* **Common Cause:** Forgetting to provide the `user-agent` and `cf_clearance` when configuring the NHentai adapter. See more information about it on [Authentication](/enma/documentation/authentication.md)
* **Code**: NHENTAI\_SOURCE\_WITHOUT\_CONFIG

## InvalidResource

* **Description**: Raised when trying to perform an action with an invalid or inexistent resource.
* **Common Cause**: Providing an inexistent folder path to downloader.
* **Code**: INVALID\_RESOURCE

## InvalidRequest

* **Description**: Raised when trying to perform an action with an invalid data type.
* **Common Cause**: Making an action with wrong parameter data type.
* **Code**: INVALID\_REQUEST

## Unknown

* **Description**: Raised when was not possible to determine the error root cause.
* **Common Cause**: Not properly handled error.
* **Code**: UNKNOWN

## NotFound

* **Description**: Raised when was not possible to find the requested resource.
* **Common Cause**: Fetching an inexistent resource.
* **Code**: NOT\_FOUND

## Forbidden

* **Description**: Raised when trying to perform a request to the source without right credentials.
* **Common Cause**: Making a request with no or invalid credentials.
* **Code**: FORBIDDEN

## ExceedRateLimit

* **Description**: Raised when trying to perform more requests than a server can handle.
* **Common Cause**: Looping through many pages without cooling down.
* **Code**: EXCEED\_RATE\_EXCEED

When encountering one of these errors, refer to the description and common cause to assist in troubleshooting.
