-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
79ef55b
commit fddaa72
Showing
11 changed files
with
209 additions
and
517 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,119 +1,4 @@ | ||
!!! note | ||
`pynyaa` only provides a single exception of its own (`HTMLParsingError`). | ||
The rest are simply re-exports from | ||
[`httpx`](https://www.python-httpx.org/exceptions/) and | ||
[`pydantic`](https://docs.pydantic.dev/latest/api/pydantic_core/#pydantic_core.ValidationError) for convenience. | ||
`pynyaa` doesn't raise any custom exceptions of it's own. The two most likely errors you'll encounter will be either of these: | ||
|
||
::: pynyaa._exceptions.HTMLParsingError | ||
::: pynyaa._exceptions.CloseError | ||
options: | ||
show_source: false | ||
members: false | ||
::: pynyaa._exceptions.ConnectError | ||
options: | ||
show_source: false | ||
members: false | ||
::: pynyaa._exceptions.ConnectTimeout | ||
options: | ||
show_source: false | ||
members: false | ||
::: pynyaa._exceptions.CookieConflict | ||
options: | ||
show_source: false | ||
members: false | ||
::: pynyaa._exceptions.DecodingError | ||
options: | ||
show_source: false | ||
members: false | ||
::: pynyaa._exceptions.HTTPError | ||
options: | ||
show_source: false | ||
members: false | ||
::: pynyaa._exceptions.HTTPStatusError | ||
options: | ||
show_source: false | ||
members: false | ||
::: pynyaa._exceptions.InvalidURL | ||
options: | ||
show_source: false | ||
members: false | ||
::: pynyaa._exceptions.LocalProtocolError | ||
options: | ||
show_source: false | ||
members: false | ||
::: pynyaa._exceptions.NetworkError | ||
options: | ||
show_source: false | ||
members: false | ||
::: pynyaa._exceptions.PoolTimeout | ||
options: | ||
show_source: false | ||
members: false | ||
::: pynyaa._exceptions.ProtocolError | ||
options: | ||
show_source: false | ||
members: false | ||
::: pynyaa._exceptions.ProxyError | ||
options: | ||
show_source: false | ||
members: false | ||
::: pynyaa._exceptions.ReadError | ||
options: | ||
show_source: false | ||
members: false | ||
::: pynyaa._exceptions.ReadTimeout | ||
options: | ||
show_source: false | ||
members: false | ||
::: pynyaa._exceptions.RemoteProtocolError | ||
options: | ||
show_source: false | ||
members: false | ||
::: pynyaa._exceptions.RequestError | ||
options: | ||
show_source: false | ||
members: false | ||
::: pynyaa._exceptions.RequestNotRead | ||
options: | ||
show_source: false | ||
members: false | ||
::: pynyaa._exceptions.ResponseNotRead | ||
options: | ||
show_source: false | ||
members: false | ||
::: pynyaa._exceptions.StreamClosed | ||
options: | ||
show_source: false | ||
members: false | ||
::: pynyaa._exceptions.StreamConsumed | ||
options: | ||
show_source: false | ||
members: false | ||
::: pynyaa._exceptions.StreamError | ||
options: | ||
show_source: false | ||
members: false | ||
::: pynyaa._exceptions.TimeoutException | ||
options: | ||
show_source: false | ||
members: false | ||
::: pynyaa._exceptions.TooManyRedirects | ||
options: | ||
show_source: false | ||
members: false | ||
::: pynyaa._exceptions.UnsupportedProtocol | ||
options: | ||
show_source: false | ||
members: false | ||
::: pynyaa._exceptions.WriteError | ||
options: | ||
show_source: false | ||
members: false | ||
::: pynyaa._exceptions.WriteTimeout | ||
options: | ||
show_source: false | ||
members: false | ||
::: pynyaa._exceptions.ValidationError | ||
options: | ||
show_source: false | ||
members: false | ||
- `pynyaa.HTTPStatusError` - Alias for [`httpx.HTTPStatusError`](https://www.python-httpx.org/exceptions/). Raised if a request returns a non 2xx status code. | ||
- `pynyaa.ValidationError` - Alias for [`pydantic.ValidationError`](https://docs.pydantic.dev/latest/errors/validation_errors/). Raised if an input is invalid. |
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,85 +1,23 @@ | ||
from httpx import HTTPStatusError | ||
from pydantic import ValidationError | ||
|
||
from ._clients import AsyncNyaa, Nyaa | ||
from ._enums import NyaaCategory | ||
from ._exceptions import ( | ||
CloseError, | ||
ConnectError, | ||
ConnectTimeout, | ||
CookieConflict, | ||
DecodingError, | ||
HTMLParsingError, | ||
HTTPError, | ||
HTTPStatusError, | ||
InvalidURL, | ||
LocalProtocolError, | ||
NetworkError, | ||
PoolTimeout, | ||
ProtocolError, | ||
ProxyError, | ||
ReadError, | ||
ReadTimeout, | ||
RemoteProtocolError, | ||
RequestError, | ||
RequestNotRead, | ||
ResponseNotRead, | ||
StreamClosed, | ||
StreamConsumed, | ||
StreamError, | ||
TimeoutException, | ||
TooManyRedirects, | ||
UnsupportedProtocol, | ||
ValidationError, | ||
WriteError, | ||
WriteTimeout, | ||
) | ||
from ._models import NyaaTorrentPage | ||
from ._types import AnyUrl, File, Filepath, HttpUrl, Torrent | ||
from ._version import _get_version | ||
from ._version import Version, _get_version | ||
|
||
__version__ = _get_version() | ||
__version_tuple__ = tuple(__version__.split(".")) | ||
__version_tuple__ = Version(*tuple(map(int, __version__.split(".")))) | ||
|
||
__all__ = [ | ||
# Clients | ||
"AsyncNyaa", | ||
"Nyaa", | ||
# Enums | ||
"NyaaCategory", | ||
# Types | ||
"AnyUrl", | ||
"HttpUrl", | ||
"Torrent", | ||
"File", | ||
"Filepath", | ||
# Models | ||
"NyaaTorrentPage", | ||
# Exceptions | ||
"CloseError", | ||
"ConnectError", | ||
"ConnectTimeout", | ||
"CookieConflict", | ||
"DecodingError", | ||
"HTMLParsingError", | ||
"HTTPError", | ||
"HTTPStatusError", | ||
"InvalidURL", | ||
"LocalProtocolError", | ||
"NetworkError", | ||
"PoolTimeout", | ||
"ProtocolError", | ||
"ProxyError", | ||
"ReadError", | ||
"ReadTimeout", | ||
"RemoteProtocolError", | ||
"RequestError", | ||
"RequestNotRead", | ||
"ResponseNotRead", | ||
"StreamClosed", | ||
"StreamConsumed", | ||
"StreamError", | ||
"TimeoutException", | ||
"TooManyRedirects", | ||
"UnsupportedProtocol", | ||
"WriteError", | ||
"WriteTimeout", | ||
"ValidationError", | ||
] |
Oops, something went wrong.