1#[derive(thiserror::Error, Debug)]
2#[non_exhaustive]
3pub 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}
55
56impl From<pdb::Error> for Error {
57 fn from(err: pdb::Error) -> Self {
58 Self::PdbError(err)
59 }
60}
61
62impl From<std::fmt::Error> for Error {
63 fn from(err: std::fmt::Error) -> Self {
64 Self::FormatError(err)
65 }
66}