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
Release history Release notifications | RSS feed
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 hashes)
Built Distribution
Close
Hashes for yoto_exception-0.1.1-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 5b0cb7a209b12c8c6bafe6df475ae06d29a2e5f08aa49b5039ea0af235e60080 |
|
MD5 | a15f154a341df8077c7b9d3b6410786e |
|
BLAKE2b-256 | f55e17e2e180b9f99ad8ec0846c37e9d0af20d2cdf37022b6a6593e9ec373586 |