-
-
Notifications
You must be signed in to change notification settings - Fork 531
Enhancement: Automatically document exceptions #2416
Copy link
Copy link
Open
Labels
EnhancementThis is a new feature or requestThis is a new feature or requestHelp Wanted 🆘This is good for people to work onThis is good for people to work on
Description
Summary
Look for litestar.HttpException exceptions in the code (+ in guards & middlewares applied?) of route handlers and add them to raises (or somewhere else), similarly what https://github.com/Kludex/fastapi-responses does.
Basic Example
from litestar import Litestar, get
from litestar.exceptions import PermissionDeniedException
@get(sync_to_thread=False)
def test(force_perm_fail: bool = False) -> None:
if force_perm_fail:
raise PermissionDeniedException
app = Litestar([test])Drawbacks and Impact
No response
Unresolved questions
No response
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
EnhancementThis is a new feature or requestThis is a new feature or requestHelp Wanted 🆘This is good for people to work onThis is good for people to work on
Type
Projects
Status
Ideas
