matter-exceptions
Table of Contents
Background
The matter-exceptions library in Python is a comprehensive package that allows developers to create and customize different types of exceptions. This library includes three major categories of exceptions, namely API exceptions, detailed exceptions, and FastAPI exceptions, that can be tailored to specific use cases.
API exceptions are designed to provide clear and concise error messages for clients accessing an API. With this library, developers can easily create and customize API exceptions that contain relevant error messages, HTTP status codes, and detailed descriptions of what went wrong. These API exceptions can also include payloads, which can be forwarded to error tracking systems for debugging and analysis purposes.
Detailed exceptions, on the other hand, are designed for internal use by developers. These exceptions can be used to catch specific errors and provide detailed information about what went wrong. Developers can easily create and customize detailed exceptions with this library, including payloads that can be sent to error tracking systems to aid in debugging.
FastAPI exceptions are designed specifically for use with the FastAPI framework. With this library, developers can create and customize FastAPI exceptions that are easy to use and integrate seamlessly with FastAPI applications. These exceptions can also contain payloads, which can be forwarded to error tracking systems for analysis and debugging purposes.
Overall, the matter-exceptions library in Python is a powerful tool that allows developers to create and customize exceptions that provide clear, concise, and detailed error messages. With the ability to include payloads, these exceptions can be used to aid in debugging and error tracking, ensuring that developers can quickly and effectively resolve any issues that arise in their applications.
Installation
Basic:
pip install matter-exceptions
With FastAPI Support:
pip install matter-exceptions[fastapi]
With Sentry Support:
pip install matter-exceptions[sentry]
With FastAPI and Sentry Support:
pip install matter-exceptions[fastapi,sentry]
Getting Started
Raise an API Exception:
from matter_exceptions.exceptions.api import ConflictError
raise ConflictError(description="test", detail="any payloads, including dicts or objects")
Raise a Fast API Exception:
from matter_exceptions.exceptions.fastapi import NotFoundError
raise NotFoundError(description="test")
Raise a Detailed Exception:
from matter_exceptions.exceptions.general import AuthenticationFailedError
raise AuthenticationFailedError(description="test")
Contributing
Make sure you have all supported python versions installed in your machine:
- 3.10
- 3.11
Install hatch in your system
https://hatch.pypa.io/latest/install/
Create the environment
hatch env create
Do your changes...
Run the tests
hatch run test
The command above will run the tests against all supported python versions installed in your machine. For testing in other operating system you may use the configured CI in github.
Bump a new version
In general, you just need to execute:
hatch version
This command will update the minor version. i.e.: No breaking changes and new feature has been added
We are using semantic version, if you are doing a bug fix:
hatch version fix
Metadata
Release files for matter-exceptions 2.0.0
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| matter_exceptions-2.0.0-py3-none-any.whl | Python 3 | none | any | Details for matter_exceptions-2.0.0-py3-none-any.whl |
Release files / matter_exceptions-2.0.0-py3-none-any.whl
| Download URL | matter_exceptions-2.0.0-py3-none-any.whl |
|---|---|
| Size | 7.2 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
e0e5ece5f283a9c6dba30da14f23539d6cd4b404d89404fbb07dc5b11d00daee
|
|
BLAKE2b-256 checksum How to use checksums |
59c97720f7dc253e4ede0d693a656e49bdae0f765766f067f40ca953e16cf7a3
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/5.0.0 CPython/3.12.2
|
Security for matter-exceptions 2.0.0
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.