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

pantsbuild / pants / 19015773527

02 Nov 2025 05:33PM UTC coverage: 17.872% (-62.4%) from 80.3%
19015773527

Pull #22816

github

web-flow
Merge a12d75757 into 6c024e162
Pull Request #22816: Update Pants internal Python to 3.14

4 of 5 new or added lines in 3 files covered. (80.0%)

28452 existing lines in 683 files now uncovered.

9831 of 55007 relevant lines covered (17.87%)

0.18 hits per line

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

82.35
/src/python/pants/base/exceptions.py
1
# Copyright 2014 Pants project contributors (see CONTRIBUTORS.md).
2
# Licensed under the Apache License, Version 2.0 (see LICENSE).
3

4
from __future__ import annotations
1✔
5

6
from typing import TYPE_CHECKING
1✔
7

8
from pants.engine.internals.native_engine import EngineError as EngineError  # noqa: F401
1✔
9
from pants.engine.internals.native_engine import (  # noqa: F401
1✔
10
    IncorrectProductError as IncorrectProductError,
11
)
12
from pants.engine.internals.native_engine import IntrinsicError as IntrinsicError  # noqa: F401
1✔
13

14
if TYPE_CHECKING:
15
    from pants.engine.internals.native_engine import PyFailure
16

17

18
class PantsException(Exception):
1✔
19
    """Base exception type for Pants."""
20

21

22
class TargetDefinitionException(PantsException):
1✔
23
    """Indicates an invalid target definition.
24

25
    :API: public
26
    """
27

28
    def __init__(self, target, msg):
1✔
29
        """
30
        :param target: the target in question
31
        :param string msg: a description of the target misconfiguration
32
        """
33
        super().__init__(f"Invalid target {target}: {msg}")
×
34

35

36
class BuildConfigurationError(PantsException):
1✔
37
    """Indicates an error in a pants installation's configuration."""
38

39

40
class BackendConfigurationError(BuildConfigurationError):
1✔
41
    """Indicates a plugin backend with a missing or malformed register module."""
42

43

44
class MappingError(PantsException):
1✔
45
    """Indicates an error mapping addressable objects."""
46

47

48
class RuleTypeError(PantsException):
1✔
49
    """Invalid @rule implementation."""
50

51

52
class NativeEngineFailure(Exception):
1✔
53
    """A wrapper around a `Failure` instance.
54

55
    The failure instance being wrapped can come from an exception raised in a rule. When this
56
    failure is returned to a requesting rule it is first unwrapped so the original exception will be
57
    presented in the rule, thus the `NativeEngineFailure` exception will not be seen in rule code.
58

59
    This is different from the other `EngineError` based exceptions which doesn't originate from
60
    rule code.
61

62
    TODO: This type is defined in Python because pyo3 doesn't support declaring Exceptions with
63
    additional fields. See https://github.com/PyO3/pyo3/issues/295
64
    """
65

66
    def __init__(self, msg: str, failure: PyFailure) -> None:
1✔
UNCOV
67
        super().__init__(msg)
×
UNCOV
68
        self.failure = failure
×
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

© 2025 Coveralls, Inc