abstracting-fastapi-services icon indicating copy to clipboard operation
abstracting-fastapi-services copied to clipboard

Why a single app_exceptions.py?

Open pycub opened this issue 3 years ago • 0 comments

I assume it's nicer to have the ./exceptions/ directory and put each service exception module containing relevant error data.

And if you were to add a new service called Bar:

./routers/      bar.py # Router instance and routes
./services/     bar.py # Business logic (including CRUD helpers)
./schemas/      bar.py # Data "schemas" (e.g., Pydantic models)
./models/       bar.py # Database models (e.g., SQLAlchemy models)
./exceptions/   bar.py # Exceptoins classes completely decoupled

pycub avatar Mar 23 '22 15:03 pycub