Skip to main content

isr_dl_windows/
error.rs

1/// Errors returned by the Windows symbol downloader.
2#[derive(thiserror::Error, Debug)]
3pub enum DownloaderError {
4    /// Filesystem I/O failed.
5    #[error(transparent)]
6    Io(#[from] std::io::Error),
7
8    /// The HTTP request to a symbol server failed.
9    #[error(transparent)]
10    Http(#[from] reqwest::Error),
11
12    /// Construction of a symbol URL failed.
13    #[error(transparent)]
14    Url(#[from] url::ParseError),
15
16    /// Parsing a PE file failed.
17    #[error(transparent)]
18    Object(#[from] object::Error),
19
20    /// The file is not a supported PE kind (neither PE32 nor PE32+).
21    #[error("unsupported file kind: {0:?}")]
22    UnsupportedFileKind(object::FileKind),
23
24    /// The PE file has no CodeView debug directory, so there is no PDB to
25    /// download.
26    #[error("CodeView info not found")]
27    MissingCodeView,
28}
29
30impl From<DownloaderError> for isr_dl::Error {
31    fn from(value: DownloaderError) -> Self {
32        isr_dl::Error::Other(Box::new(value))
33    }
34}