Skip to main content

yoto_api的异常模块

Project description

yoto_excpetion

yoto_api的异常类,包括错误码和错误提示

要求: Python 3.9+


错误码

错误码文档:错误码


更新pypi的包

1、生成wheel包

python3 setup.py sdist bdist_wheel

2、上传wheel文件

账号密码可以直接输入,也可以生成一个文件$HOME/.pypirc,内容如下:

[pypi]

    username = __token__

    password = pypi-AgEIcHlwaS5vcmcCJDk3MjE5MzdjLWEyYmMtNGI5OC05YmU3LTdmNzFkNjRiMjc3MgACJXsicGVybWlzc2lvbnMiOiAidXNlciIsICJ2ZXJzaW9uIjogMX0AAAYgBOxVPheoeWle95iQjr7l65chP_KbSrhVxze6o3S9AMA
python3 -m twine upload dist/*

安装

pip install -i https://test.pypi.org/simple/ yoto-exception

使用

    from yoto_excpetion import register_exception

    from src.core.log import logger
    from src.utils.common import alarm


    def create_app(app: FastAPI):

        ... 添加一些操作在捕获异常之前

        register_exception(app, logger, alarm)  # 注册捕获异常信息

        ... 添加一些操作在捕获异常之后

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

yoto_exception-0.1.1.tar.gz (10.5 kB view details)

Uploaded Source

Built Distribution

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

yoto_exception-0.1.1-py3-none-any.whl (13.3 kB view details)

Uploaded Python 3

File details

Details for the file yoto_exception-0.1.1.tar.gz.

File metadata

  • Download URL: yoto_exception-0.1.1.tar.gz
  • Upload date:
  • Size: 10.5 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.2.0 pkginfo/1.6.1 requests/2.24.0 setuptools/50.3.2 requests-toolbelt/0.9.1 tqdm/4.51.0 CPython/3.9.0

File hashes

Hashes for yoto_exception-0.1.1.tar.gz
Algorithm Hash digest
SHA256 cc78a0ebd02a5eafd3018fffe54ac70148d488738979317e09796a3955e3c4be
MD5 e2fd8b02c33ab8f1522fb2ebca63c392
BLAKE2b-256 d24bc3320b49fd3273639cbdb979995f7435c64911adc75ae9a8be134956d1f8

See more details on using hashes here.

File details

Details for the file yoto_exception-0.1.1-py3-none-any.whl.

File metadata

  • Download URL: yoto_exception-0.1.1-py3-none-any.whl
  • Upload date:
  • Size: 13.3 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.2.0 pkginfo/1.6.1 requests/2.24.0 setuptools/50.3.2 requests-toolbelt/0.9.1 tqdm/4.51.0 CPython/3.9.0

File hashes

Hashes for yoto_exception-0.1.1-py3-none-any.whl
Algorithm Hash digest
SHA256 5b0cb7a209b12c8c6bafe6df475ae06d29a2e5f08aa49b5039ea0af235e60080
MD5 a15f154a341df8077c7b9d3b6410786e
BLAKE2b-256 f55e17e2e180b9f99ad8ec0846c37e9d0af20d2cdf37022b6a6593e9ec373586

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