llvm_mapper/
error.rs

1//! Errors for `llvm-mapper`.
2
3use llvm_bitstream::error::Error as BitstreamError;
4use thiserror::Error as ThisError;
5
6use crate::block::BlockMapError;
7
8/// All possible errors that can occur while mapping a bitstream.
9///
10/// The error variants here are deeply nested.
11#[non_exhaustive]
12#[derive(Debug, ThisError)]
13pub enum Error {
14    /// We encountered an error while performing the underlying bitstream parse.
15    #[error("error while parsing the bitstream")]
16    Parse(#[from] BitstreamError),
17
18    /// We couldn't unroll the stream because of a structural error.
19    #[error("error while unrolling the bitstream: {0}")]
20    Unroll(String),
21
22    /// We couldn't perform the bitstream map.
23    #[error("error while mapping the bitsteam")]
24    Map(#[from] BlockMapError),
25}