Skip to content
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

feat: implement RequestError #119

Merged
merged 4 commits into from
Dec 3, 2024
Merged

feat: implement RequestError #119

merged 4 commits into from
Dec 3, 2024

Conversation

janbritz
Copy link
Contributor

Mithilfe einer Middleware werden alle Exceptions zu dem in der QPPE definierten RequestError transformiert.
Sollte eine unbekannte Exception geraised werden, wird diese zu einem ServerError umgewandelt.

Außerdem wird die veraltete NotFoundStatus-Komponente aus der QPPE entfernt.

PS: da ich Probleme mit pytest hatte, musste ich poe up ausführen, das Update kann ich aber gerne auch aus dem PR entfernen.

Copy link
Contributor

@MartinGauk MartinGauk left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Die Updates der Abhängigkeiten sollten nicht mehr notwendig sein. Zur besseren Übersicht sollten wir auf Updates in PRs verzichten, wenn es nicht inhaltlich notwendig ist.

questionpy_server/web/_middlewares.py Outdated Show resolved Hide resolved
questionpy_server/web/_middlewares.py Outdated Show resolved Hide resolved
questionpy_server/worker/impl/subprocess.py Outdated Show resolved Hide resolved
questionpy_server/web/_middlewares.py Outdated Show resolved Hide resolved
questionpy_server/web/_middlewares.py Outdated Show resolved Hide resolved
questionpy_common/error.py Outdated Show resolved Hide resolved
questionpy_server/web/errors.py Outdated Show resolved Hide resolved
Comment on lines 55 to 56
except web.HTTPException:
raise
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ich denke es wäre wünschenswert, dass alle generierten HTTP-Fehler einen Body der gleichen Struktur haben. Wenn ich das richtig sehe, werden noch an 4 Stellen direkt HTTPExceptions ohne Body geworfen. Ich würde gerne entweder diese Stellen durch QPyBaseErrors ersetzen, oder ihnen hier einen Body verpassen, wenn sie noch keinen haben.

questionpy_server/web/errors.py Outdated Show resolved Hide resolved
questionpy_server/web/errors.py Outdated Show resolved Hide resolved
questionpy_server/models.py Outdated Show resolved Hide resolved
questionpy_server/web/errors.py Outdated Show resolved Hide resolved
questionpy_server/worker/runtime/messages.py Outdated Show resolved Hide resolved
questionpy_server/web/_decorators.py Outdated Show resolved Hide resolved
@janbritz janbritz merged commit 9b8612f into dev Dec 3, 2024
6 checks passed
@janbritz janbritz deleted the feat/request-error-type branch December 3, 2024 14:21
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants