-
Notifications
You must be signed in to change notification settings - Fork 1
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add logging #92
base: main
Are you sure you want to change the base?
Add logging #92
Conversation
As middleware for any request
Coverage Report
Summary
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
я не знаю как хендлить ошибки в middleware, нужно ли делать
try:...
except Exception as e:
# compute something
raise e
то есть нужно ли ререйзить ошибки или нет (но вроде нет и у тебя норм всё)
💩 Code linting failed, use |
Примерно следующее пишем в маркетинг:
Про тесты |
|
|
Про тесты. |
5хх это ошибка на стороне сервера, а 4хх на стороне клиента |
💩 Code linting failed, use |
Не знаю как получить токен => user_id Не могу написать тесты, так же интеграционные |
Add logging middleware for any request and deliver logs to marketing_api
Изменения
Добавил middleware, который обрабатывает абсолютно каждый запрос HTTP/HTTPS
Это встроенный способ FastAPI глобально перехватывать и модифицировать все HTTP-запросы и ответы.
Можно изменять заголовки, логировать, валидировать, перехватывать ошибки и многое другое.
Детали реализации
Check-List
black
иisort
для Back-End илиPrettier
для Front-End?