neterr
Groupings of exceptions for working with network requests.
When making network requests in python there are a number of possible exceptions to due network issues. These are often a temporarily problem that should be prioritized separately from a bug in code. As a result handling them with a bare except is not safe but knowing exactly what exceptions to handle can be difficult.
Installation
pip install neterr
Error Groups
neterr provides the exception groups SocketErrors, StrictHTTPErrors, AmbiguousHTTPErrors and HTTPErrors.
Usage Example
import urllib.request
from neterr import HTTPErrors
try:
urllib.request.urlopen('http://127.0.0.1').read()
except HTTPErrors:
print('caught!')
SocketErrors
SocketErrors contains exceptions that may be raised while working with the socket module.
StrictHTTPErrors
StrictHTTPErrors contains exceptions that may be raised while working with the http module and some common modules that use it (such as urllib and requests). This grouping only contains exceptions that are clearly not the result of code. They may be caused by an infrastructure or configuration problem and are often temporary.
StrictHTTPErrors is a superset of SocketErrors.
AmbiguousHTTPErrors
AmbiguousHTTPErrors contains exceptions that may be raised while working with the http module and some common modules that use it (such as urllib and requests). This grouping contains exceptions that may or may not be caused by code. The most common reason for this ambiguity is that they are the result of an HTTP response with a 4xx or 5xx status. It is recommended to handle 4xx and 5xx responses separately. 4xx responses are often caused by unvalidated user input or another code issue. 5xx responses are often caused by temporarily unavailability in a dependent service.
HTTPErrors
StrictHTTPErrors contains exceptions that may be raised while working with the http module and some common modules that use it (such as urllib and requests).
HTTPErrors is a superset of StrictHTTPErrors and AmbiguousHTTPErrors.
Versioning
This package strictly follows semantic versioning.
Metadata
Release files for neterr 1.0.1
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | |
|---|---|---|---|---|
| neterr-1.0.1.tar.gz | 9.2 kB | Without provenance | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| neterr-1.0.1-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 15.9 kB
Release files / neterr-1.0.1.tar.gz
| Download URL | neterr-1.0.1.tar.gz |
|---|---|
| Size | 9.2 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
f58ba04095f030a5ad02a7dd309ddaa51137493685660d8960a6c5055c9fe1ab
|
|
BLAKE2b-256 checksum How to use checksums |
c4aac4fb32e9737ef67a8b520044ff823b14fd7972e4d1b81578c9cc65a1b7e7
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/3.1.0 pkginfo/1.5.0.1 requests/2.22.0 setuptools/41.2.0 requests-toolbelt/0.9.1 tqdm/4.39.0 CPython/3.8.0
|
Release files / neterr-1.0.1-py3-none-any.whl
| Download URL | neterr-1.0.1-py3-none-any.whl |
|---|---|
| Size | 6.7 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
7afe99e1b818d6e88df39c4bd6592416da92d8e37c69e37fc7ae8282b4d335b8
|
|
BLAKE2b-256 checksum How to use checksums |
42f491f09d9bd50e3dc2ed50b0dcd45a7c21756b079753ef20f4d1f6c900f596
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/3.1.0 pkginfo/1.5.0.1 requests/2.22.0 setuptools/41.2.0 requests-toolbelt/0.9.1 tqdm/4.39.0 CPython/3.8.0
|
Security for neterr 1.0.1
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.