forked from coveragepy/coveragepy
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathexceptions.py
More file actions
85 lines (48 loc) · 1.6 KB
/
Copy pathexceptions.py
File metadata and controls
85 lines (48 loc) · 1.6 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
# Licensed under the Apache License: http://www.apache.org/licenses/LICENSE-2.0
# For details: https://github.com/coveragepy/coveragepy/blob/main/NOTICE.txt
"""Exceptions coverage.py can raise."""
from __future__ import annotations
from typing import Any
class CoverageException(Exception):
"""The base class of all exceptions raised by Coverage.py."""
def __init__(
self,
*args: Any,
slug: str | None = None,
) -> None:
"""Create an exception.
Args:
slug: A short string identifying the exception, will be used for
linking to documentation.
"""
super().__init__(*args)
self.slug = slug
class ConfigError(CoverageException):
"""A problem with a config file, or a value in one."""
pass
class DataError(CoverageException):
"""An error in using a data file."""
pass
class NoDataError(CoverageException):
"""We didn't have data to work with."""
pass
class NoSource(CoverageException):
"""We couldn't find the source for a module."""
pass
class NoCode(NoSource):
"""We couldn't find any code at all."""
pass
class NotPython(CoverageException):
"""A source file turned out not to be parsable Python."""
pass
class PluginError(CoverageException):
"""A plugin misbehaved."""
pass
class _ExceptionDuringRun(CoverageException):
"""An exception happened while running customer code.
Construct it with three arguments, the values from `sys.exc_info`.
"""
pass
class CoverageWarning(Warning):
"""A warning from Coverage.py."""
pass