feat: rework Exception/ApiError (#107)

* feat: rework Exception/ApiError

* docs: update exceptions module

* fix: docstring
This commit is contained in:
d3vyce
2026-03-02 16:34:29 +01:00
committed by GitHub
parent 4a020c56d1
commit 05b5a2c876
5 changed files with 603 additions and 174 deletions

View File

@@ -410,7 +410,7 @@ class TestNoSearchableFieldsError:
from fastapi_toolsets.exceptions import NoSearchableFieldsError
error = NoSearchableFieldsError(User)
assert "User" in str(error)
assert "User" in error.api_error.desc
assert error.model is User
def test_error_raised_when_no_fields(self):
@@ -434,7 +434,7 @@ class TestNoSearchableFieldsError:
build_search_filters(NoStringModel, "test")
assert exc_info.value.model is NoStringModel
assert "NoStringModel" in str(exc_info.value)
assert "NoStringModel" in exc_info.value.api_error.desc
class TestGetSearchableFields: