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

Clinical-Genomics / cg / 12831955796

17 Jan 2025 03:25PM UTC coverage: 85.401%. First build
12831955796

Pull #4114

github

web-flow
Merge 964691ea2 into cdb446586
Pull Request #4114: (Improve order flow) Add error logging

3 of 14 new or added lines in 2 files covered. (21.43%)

25651 of 30036 relevant lines covered (85.4%)

0.85 hits per line

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

58.33
/cg/services/orders/validation/errors/validation_errors.py
1
from pydantic import BaseModel
1✔
2

3
from cg.services.orders.validation.errors.case_errors import CaseError
1✔
4
from cg.services.orders.validation.errors.case_sample_errors import CaseSampleError
1✔
5
from cg.services.orders.validation.errors.order_errors import OrderError
1✔
6
from cg.services.orders.validation.errors.sample_errors import SampleError
1✔
7

8

9
class ValidationErrors(BaseModel):
1✔
10
    order_errors: list[OrderError] = []
1✔
11
    case_errors: list[CaseError] = []
1✔
12
    sample_errors: list[SampleError] = []
1✔
13
    case_sample_errors: list[CaseSampleError] = []
1✔
14

15
    @property
1✔
16
    def is_empty(self) -> bool:
1✔
17
        """Return True if there are no errors in any of the attributes."""
18
        return all(not getattr(self, field) for field in self.model_fields)
1✔
19

20
    def get_error_message(self) -> str:
1✔
21
        """Gets a string documenting all errors."""
NEW
22
        error_string = ""
×
NEW
23
        for error in self.order_errors:
×
NEW
24
            error_string += f"Problem with {error.field}: {error.message} \n"
×
NEW
25
        for error in self.case_errors:
×
NEW
26
            error_string += (
×
27
                f"Problem with {error.field} in case {error.case_index}: {error.message} \n"
28
            )
NEW
29
        for error in self.case_sample_errors:
×
NEW
30
            error_string += f"Problem with {error.field} in case {error.case_index} sample {error.sample_index}: {error.message} \n"
×
NEW
31
        for error in self.sample_errors:
×
NEW
32
            error_string += (
×
33
                f"Problem with {error.field} in sample {error.sample_index}: {error.message} \n"
34
            )
NEW
35
        return error_string
×
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