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

Clinical-Genomics / cg / 11437938395

21 Oct 2024 10:11AM UTC coverage: 80.562%. First build
11437938395

Pull #3864

github

web-flow
Merge e32ebfdbf into 217bd123d
Pull Request #3864: add application ordertype endpoint

52 of 76 new or added lines in 9 files covered. (68.42%)

10979 of 13628 relevant lines covered (80.56%)

1.7 hits per line

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

55.56
/cg/server/endpoints/error_handler.py
1
import logging
1✔
2
from functools import wraps
1✔
3
from http import HTTPStatus
1✔
4

5
from flask import jsonify
1✔
6

7
from cg.store.exc import EntryNotFoundError
1✔
8

9
LOG = logging.getLogger(__name__)
1✔
10

11

12
def handle_endpoint_errors(func):
1✔
13
    @wraps(func)
1✔
14
    def wrapper(*args, **kwargs):
1✔
NEW
15
        try:
×
NEW
16
            return func(*args, **kwargs)
×
NEW
17
        except EntryNotFoundError as error:
×
NEW
18
            LOG.error(error)
×
NEW
19
            return jsonify(error=str(error)), HTTPStatus.NOT_FOUND
×
NEW
20
        except Exception as error:
×
NEW
21
            LOG.error(f"Unexpected error in endpoint: {error}")
×
NEW
22
            return (
×
23
                jsonify(error="An error occurred while processing your request."),
24
                HTTPStatus.INTERNAL_SERVER_ERROR,
25
            )
26

27
    return wrapper
1✔
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