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.
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.
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.
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.
Common Cause: Consecutive failures when trying to fetch a random doujin from NHentai.
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
andcf_clearance
when configuring the NHentai adapter. See more information about it on AuthenticationCode: 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.
Last updated
Was this helpful?