Skip to main content

Error schema validator

Project description

PyErrorSchema

Installation

The source code is currently hosted on GitHub at here.

Binary installers for the latest released version are available at the Python Package Index (PyPI).

pip install pyerrorschema

Examples

from pyerrorschema import FastAPIErrorSchema

# Creating a error schema
err = FastAPIErrorSchema.database_error(
    loc=["request", "body"],
    input={'data_path': 'test'},
)

# Converting the error to a dictionary and printing it
print(err.to_dict())

This will output:

{'type': 'database_error', 'msg': 'Database operation failed.', 'loc': ['request', 'body'], 'input': {'data_path': 'test'}}

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

pyerrorschema-0.1.2.tar.gz (4.4 kB view hashes)

Uploaded Source

Built Distribution

pyerrorschema-0.1.2-py3-none-any.whl (5.4 kB view hashes)

Uploaded Python 3

Supported by

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