Skip to main content

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]

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

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

No source distribution files available for this release.See tutorial on generating distribution archives.

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

matter_exceptions-2.0.0-py3-none-any.whl (7.2 kB view details)

Uploaded Python 3

File details

Details for the file matter_exceptions-2.0.0-py3-none-any.whl.

File metadata

File hashes

Hashes for matter_exceptions-2.0.0-py3-none-any.whl
Algorithm Hash digest
SHA256 e0e5ece5f283a9c6dba30da14f23539d6cd4b404d89404fbb07dc5b11d00daee
MD5 42f080b02f02b84826932ce9d2294703
BLAKE2b-256 59c97720f7dc253e4ede0d693a656e49bdae0f765766f067f40ca953e16cf7a3

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page