Drop the type ignore comment from error classification
ty accepts the lookup without it, and the project keeps code free of comments. Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01V1d3RLHNBBMA6UqBLLJv27
This commit is contained in:
co-authored by
Claude Opus 5.5
parent
a761b718b8
commit
e9242816a5
@@ -1,7 +1,7 @@
|
|||||||
## 1. Требования и код
|
## 1. Требования и код
|
||||||
|
|
||||||
- [x] 1.1 Тест порядка проверок `POST …/messages` для постороннего (`test_request_shape_is_checked_before_access`)
|
- [x] 1.1 Тест порядка проверок `POST …/messages` для постороннего (`test_request_shape_is_checked_before_access`)
|
||||||
- [ ] 1.2 Убрать `# type: ignore` из `shared/entrypoints/errors.py`
|
- [x] 1.2 Убрать `# type: ignore` из `shared/entrypoints/errors.py`
|
||||||
- [ ] 1.3 `openspec/config.yaml`: `gunicorn_conf.py` в карте модулей
|
- [ ] 1.3 `openspec/config.yaml`: `gunicorn_conf.py` в карте модулей
|
||||||
- [ ] 1.4 Проверка группы: `make lint`, `make student-test`, `make check`
|
- [ ] 1.4 Проверка группы: `make lint`, `make student-test`, `make check`
|
||||||
|
|
||||||
|
|||||||
@@ -46,7 +46,7 @@ class Unauthenticated(Exception):
|
|||||||
|
|
||||||
def classify(error: DomainError, codes: ErrorCodes) -> tuple[str, int]:
|
def classify(error: DomainError, codes: ErrorCodes) -> tuple[str, int]:
|
||||||
for kind in type(error).__mro__:
|
for kind in type(error).__mro__:
|
||||||
known = codes.get(kind) # type: ignore[arg-type]
|
known = codes.get(kind)
|
||||||
if known is not None:
|
if known is not None:
|
||||||
return known
|
return known
|
||||||
return "internal_error", status.HTTP_500_INTERNAL_SERVER_ERROR
|
return "internal_error", status.HTTP_500_INTERNAL_SERVER_ERROR
|
||||||
|
|||||||
Reference in New Issue
Block a user