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

pantsbuild / pants / 21552830208

31 Jan 2026 11:40PM UTC coverage: 80.277% (-0.05%) from 80.324%
21552830208

Pull #23062

github

web-flow
Merge 808a9786c into 2c4dcf9cf
Pull Request #23062: Remove support for Get

18 of 25 new or added lines in 4 files covered. (72.0%)

17119 existing lines in 541 files now uncovered.

78278 of 97510 relevant lines covered (80.28%)

3.36 hits per line

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

94.12
/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
12✔
5

6
from typing import TYPE_CHECKING
12✔
7

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

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

17

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

21

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

25
    :API: public
26
    """
27

28
    def __init__(self, target, msg):
12✔
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):
12✔
37
    """Indicates an error in a pants installation's configuration."""
38

39

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

43

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

47

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

51

52
class NativeEngineFailure(Exception):
12✔
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:
12✔
UNCOV
67
        super().__init__(msg)
1✔
UNCOV
68
        self.failure = failure
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