miden_mast_package/package/
error.rs1use alloc::string::String;
2
3use miden_core::serde::DeserializationError;
4
5use super::section::SectionId;
6use crate::debug_info::InvalidOptionalIndexError;
7
8#[derive(Debug, thiserror::Error)]
10pub enum PackageStripError {
11 #[error("failed to decode embedded kernel package while stripping debug info: {source}")]
12 DecodeEmbeddedKernel {
13 #[source]
14 source: DeserializationError,
15 },
16}
17
18#[derive(Debug, thiserror::Error)]
20pub enum PackageDebugInfoError {
21 #[error("package debug sections are present but are not trusted")]
22 UntrustedSections,
28 #[error("package contains multiple '{id}' debug sections")]
29 DuplicateSection {
30 id: SectionId,
32 },
33 #[error("failed to decode '{id}' debug section: {source}")]
34 DecodeSection {
35 id: SectionId,
37 #[source]
39 source: DeserializationError,
40 },
41 #[error("'{id}' debug section has trailing bytes")]
42 TrailingBytes {
43 id: SectionId,
45 },
46 #[error("invalid package debug info: {message}")]
47 InvalidReference { message: String },
48 #[error("invalid optional field discriminant for {context}: {err}")]
49 InvalidOptionField {
50 #[source]
51 err: InvalidOptionalIndexError,
52 context: String,
53 },
54}