Coverage Report

Created: 2026-11-11 06:34

next uncovered line (L), next uncovered region (R), next uncovered branch (B)
/rust/registry/src/index.crates.io-1949cf8c6b5b557f/pdb-addr2line-0.12.1/src/error.rs
Line
Count
Source
1
#[derive(thiserror::Error, Debug)]
2
#[non_exhaustive]
3
pub enum Error {
4
    #[error("Formatting error: {0}")]
5
    FormatError(#[source] std::fmt::Error),
6
7
    #[error("PDB error: {0}")]
8
    PdbError(#[source] pdb::Error),
9
10
    #[error("Unexpected type for argument list")]
11
    ArgumentTypeNotArgumentList,
12
13
    #[error("Id of type Function doesn't have type of Procedure")]
14
    FunctionIdIsNotProcedureType,
15
16
    #[error("Id of type MemberFunction doesn't have type of MemberFunction")]
17
    MemberFunctionIdIsNotMemberFunctionType,
18
19
    #[error("There are consecutive section contributions for module {0} and section {1} which are not ordered by offset")]
20
    UnorderedSectionContributions(usize, u16),
21
22
    #[error("Overlapping section contributions in section {0} from modules {1} and {2}")]
23
    OverlappingSectionContributions(u16, usize, usize),
24
25
    #[error("Getting the procedure lines was unsuccessful")]
26
    ProcedureLinesUnsuccessful,
27
28
    #[error("Getting the procedure inline ranges was unsuccessful")]
29
    ProcedureInlineRangesUnsuccessful,
30
31
    #[error("Getting the extended module info was unsuccessful")]
32
    ExtendedModuleInfoUnsuccessful,
33
34
    #[error("Could not resolve cross-module reference due to missing string table")]
35
    CantResolveCrossModuleRefWithoutStringTable,
36
37
    #[error("Getting the module imports was unsuccessful")]
38
    ModuleImportsUnsuccessful,
39
40
    #[error("Could not find the module with name {0}")]
41
    ModuleNameNotFound(String),
42
43
    #[error("Getting the module exports was unsuccessful")]
44
    ModuleExportsUnsuccessful,
45
46
    #[error("The local index {0} was not found in the module exports")]
47
    LocalIndexNotInExports(u32),
48
49
    #[error("The module index {0} was out-of-range.")]
50
    OutOfRangeModuleIndex(usize),
51
52
    #[error("Could not get the ModuleInfo for module index {0}")]
53
    ModuleInfoNotFound(usize),
54
    #[error("Type with index {0} is circular")]
55
    CircularTypeDefinition(u32),
56
}
57
58
impl From<pdb::Error> for Error {
59
36.4k
    fn from(err: pdb::Error) -> Self {
60
36.4k
        Self::PdbError(err)
61
36.4k
    }
62
}
63
64
impl From<std::fmt::Error> for Error {
65
0
    fn from(err: std::fmt::Error) -> Self {
66
0
        Self::FormatError(err)
67
0
    }
68
}
69
70
impl From<crate::type_formatter::AlreadySeenError> for Error {
71
24
    fn from(value: crate::type_formatter::AlreadySeenError) -> Self {
72
24
        Self::CircularTypeDefinition(value.0 .0)
73
24
    }
74
}