• Home
  • Features
  • Pricing
  • Docs
  • Announcements
  • Sign In

Brunowar12 / TaskManagerSystem / 14977388329

12 May 2025 04:21PM UTC coverage: 94.158%. First build
14977388329

Pull #22

github

web-flow
Merge f50f0856e into 7f7191a36
Pull Request #22: Polishing & refinement

653 of 683 new or added lines in 28 files covered. (95.61%)

1499 of 1592 relevant lines covered (94.16%)

9.42 hits per line

Source File
Press 'n' to go to next uncovered line, 'b' for previous

75.0
/TaskManagerSystem/views.py
1
import logging
10✔
2
from rest_framework import status
10✔
3
from rest_framework.views import exception_handler
10✔
4

5
from api.utils import error_response
10✔
6

7
logger = logging.getLogger(__name__)
10✔
8

9
def custom_exception_handler(exc, context):
10✔
10
    """
11
    Custom handler for exceptions in the API
12
    """
13
    response = exception_handler(exc, context)
10✔
14

15
    # Adaptive logging depending on the type of error
16
    if response is not None:
10✔
17
        if response.status_code >= 500:
10✔
18
            logger.error(f"Server error: {exc}", exc_info=True)
×
19
        elif response.status_code >= 400:
10✔
20
            logger.warning(f"Client error: {exc}")
10✔
21
        else:
22
            logger.info(f"Other exception: {exc}")
×
23
    else:
24
        logger.error(f"Unhandled exception: {exc}", exc_info=True)
×
NEW
25
        return error_response(
×
26
            "Internal server error. Please try again later", 
27
            status.HTTP_500_INTERNAL_SERVER_ERROR
28
        )
29

30
    return response
10✔
STATUS · Troubleshooting · Open an Issue · Sales · Support · CAREERS · ENTERPRISE · START FREE · SCHEDULE DEMO
ANNOUNCEMENTS · TWITTER · TOS & SLA · Supported CI Services · What's a CI service? · Automated Testing

© 2026 Coveralls, Inc