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

pantsbuild / pants / 18252174847

05 Oct 2025 01:36AM UTC coverage: 43.382% (-36.9%) from 80.261%
18252174847

push

github

web-flow
run tests on mac arm (#22717)

Just doing the minimal to pull forward the x86_64 pattern.

ref #20993

25776 of 59416 relevant lines covered (43.38%)

1.3 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
3✔
5

6
from typing import TYPE_CHECKING
3✔
7

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

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

17

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

21

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

25
    :API: public
26
    """
27

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

39

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

43

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

47

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

51

52
class NativeEngineFailure(Exception):
3✔
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:
3✔
67
        super().__init__(msg)
×
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