构造参数校验错误。
(detail: str, suggestion: str = "请检查输入后重试")
| 64 | |
| 65 | |
| 66 | def validation_error(detail: str, suggestion: str = "请检查输入后重试") -> AppError: |
| 67 | """构造参数校验错误。""" |
| 68 | return AppError( |
| 69 | code="INVALID_REQUEST", |
| 70 | title="请求参数不完整", |
| 71 | detail=detail, |
| 72 | suggestion=suggestion, |
| 73 | status=400, |
| 74 | retryable=False, |
| 75 | ) |
| 76 | |
| 77 | |
| 78 | def normalize_error_result(result: dict, context: dict = None, fallback_status: int = 500) -> dict: |