use binrw::Error as BinrwError;
use thiserror::Error;
#[derive(Debug, Error)]
pub enum UserDmpError {
#[error("Failed to open file: {0}")]
FileOpenError(#[from] std::io::Error),
#[error("Invalid minidump signature.")]
InvalidSignature,
#[error("The minidump contains invalid or unsupported flags: {0:#x}")]
InvalidFlags(u64),
#[error("Unsupported architecture: {0}")]
UnsupportedArchitecture(u16),
#[error("Failed to parse system info: {0}")]
ParseSystemInfoError(std::io::Error),
#[error("Failed to parse module list: {0}")]
ParseModuleListError(std::io::Error),
#[error("Invalid memory range in module.")]
InvalidMemoryRange,
#[error("Failed to create file mapping.")]
CreateFileMappingError,
#[error("Failed to map view of file.")]
MapViewOfFileError,
#[error("Failed to map view of file.")]
MmapError,
#[error("Parsing error: {0}")]
BinrwError(#[from] BinrwError),
#[error("Address {0:#x?} was not found in Memory64ListStream")]
AddressNotFound(u64),
#[error("Invalid context")]
InvalidContext,
}