avantifellows / avantifellows/reporting

Enhance Error Handling in SessionQuizReportsRouter

Open
#53 1 comment 0 reactions 0 assignees View on GitHub
Dominant language
Python
Stars
2
Forks
5
Avg merge
1m
Merged PRs (30d)
3

Description

## Description:
The current implementation of the SessionQuizReportsRouter lacks robust error handling in some areas, such as database access failures and template rendering issues. To make the application more reliable, we need to improve error handling by:

Adding proper error handling for database access and rendering failures.
Raising appropriate HTTP exceptions with user-friendly messages.
Logging critical errors for better traceability in production environments.
## Tasks:
Add try-except blocks around database calls to handle exceptions.
Add error handling for template rendering failures (e.g., TemplateError).
Log critical errors with appropriate logging levels (only ERROR or higher).
Ensure all exceptions result in meaningful HTTP responses (e.g., 500 Internal Server Error).
Test the endpoints to ensure error handling is functioning correctly.

Contributor guide

No contributing guide indexed for this repository

Research direction

Start by locating SessionQuizReportsRouter and tracing its database calls and template rendering paths. Exercise the affected endpoints with database and rendering failures, then add coverage for meaningful 500 responses and ERROR-level logging. Done means these failures are handled consistently and the endpoint tests pass.

Written by the indexing model from the issue text.

Assessment

Tech stack
python
Domain
api, backend
Issue type
Feature
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.