No project description provided
Project description
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]
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
Project details
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distributions
Built Distribution
Hashes for matter_exceptions-1.0.1-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 8ac25381309aef13594e9e7ee70e206a00cb0ebb5fe60ae342835a044165af38 |
|
MD5 | b118fb9b255f14150e9c971da198e446 |
|
BLAKE2b-256 | db7180690780484af9e0ade3092380acf1e8858712fab9a711ca75087340ed47 |