Files
assist/src/web/__pycache__/error_handlers.cpython-310.pyc

19 lines
2.8 KiB
Plaintext
Raw Normal View History

o
l<>h<EFBFBD> <00> @s<>dZddlZddlmZddlmZmZmZddlm Z e<01>
e <0B>Z dedefdd <09>Z dedefd
d <0B>Zdedefd d <0A>Zddedededefdd<13>Zddededeeeffdd<17>ZdS)uB
错误处理装饰器和工具
提供统一的错误处理模式
<EFBFBD>N)<01>wraps)<03>Callable<6C>Any<6E>Dict)<01>jsonify<66>func<6E>returnc<00>&t<00><00>dtttff<02>fdd<03> <0C>}|S)uAPI错误处理装饰器rc
sdz<08>|i|<01><01>WSty3}zt<01>d<01>j<03>d|<02><00><04>tddt|<02><01><00>i<01>dfWYd}~Sd}~wty]}zt<01>d<06>j<03>d|<02><00><04>tddt|<02><01><00>i<01>dfWYd}~Sd}~wty<>}zt<01>d <09>j<03>d|<02><00><04>tdd
t|<02><01><00>i<01>d fWYd}~Sd}~wty<>}zt<01> d <0C>j<03>d|<02><00><04>tdd t|<02><01><00>i<01>dfWYd}~Sd}~ww)Nu 参数错误 <20>: <20>erroru参数错误: i<>u 权限错误 u权限不足: i<>u文件未找到 u文件未找到: i<>u未处理错误 u服务器内部错误: <20><>)
<EFBFBD>
ValueError<EFBFBD>logger<65>warning<6E>__name__r<00>str<74>PermissionError<6F>FileNotFoundError<6F> Exceptionr <00><03>args<67>kwargs<67>e<>r<00><00>&/root/assist/src/web/error_handlers.py<70>wrappers&&<08>&<08>&<08>&<08><02>z"handle_api_errors.<locals>.wrapper<65>rrrr<00>rrrrr<00>handle_api_errorssrcr )u数据库错误处理装饰器rc
<00>^z<08>|i|<01><01>WSty.}zt<01>d<01>j<03>d|<02><00><04>tddi<01>dfWYd}~Sd}~ww)Nu数据库错误 r
r u数据库操作失败r <00>rrr rrrrrrr&<00><08><02>z'handle_database_errors.<locals>.wrapperrrrrr<00>handle_database_errors$<00>r#cr )u服务错误处理装饰器rc
r )Nu 服务错误 r
r u服务暂时不可用i<E794A8>r!rrrrr2r"z&handle_service_errors.<locals>.wrapperrrrrr<00>handle_service_errors0r$r%r <00>message<67> status_code<64>detailscCs6d|i}|r
||d<t<00>d|<00>d|<02><00><04>t|<03>|fS)u创建标准错误响应r r(u错误响应: z - )rr r)r&r'r(<00>responserrr<00>create_error_response<s
 r*<00> 操作成功<E68890>datacCsd|d<02>}|dur ||d<|S)u创建标准成功响应T)<02>successr&Nr,r)r,r&r)rrr<00>create_success_responseEs
r.)r N)Nr+)<15>__doc__<5F>logging<6E> functoolsr<00>typingrrr<00>flaskr<00> getLoggerrrrr#r%r<00>int<6E>tupler*r.rrrr<00><module>s  
  $