Skip to main content

process_backend/local/
error.rs

1use core::ffi::c_int;
2
3#[derive(Debug, thiserror::Error, serde::Serialize, serde::Deserialize)]
4pub enum Error {
5    #[error("failed to send SIGSTOP to process: {0}")]
6    SigStopFailed(c_int),
7    #[error("failed to send SIGCONT to process: {0}")]
8    SigContFailed(c_int),
9    #[error("failed to attach to process: {0}")]
10    PtraceAttachFailed(c_int),
11    #[error("failed to detach from process: {0}")]
12    PtraceDetachFailed(c_int),
13    #[error("failed to peek at process user section: {0}")]
14    PtracePeekUserFailed(c_int),
15    #[error("failed waiting for thread to stop: {0}")]
16    WaitPidFailed(c_int),
17    #[error("unexpected status returned waiting for thread to stop: {0}")]
18    UnexpectedStatus(c_int),
19    #[error("failed to reinject signal {0} into stopped process: {1}")]
20    ReinjectFailed(c_int, c_int),
21    #[error("failed to stat file: {0}")]
22    StatFailed(c_int),
23    #[error("failed to open file: {0}")]
24    OpenFileFailed(c_int),
25    #[error("failed to read file: {0}")]
26    ReadFileFailed(c_int),
27    #[error("failed to open directory: {0}")]
28    OpenDirFailed(c_int),
29    #[error("I/O error reading directory: {0}")]
30    ReadDirFailed(c_int),
31    #[error("failed to read link: {0}")]
32    ReadLinkFailed(c_int),
33    #[error("buffer too small")]
34    BufferTooSmall,
35    #[error("not supported")]
36    NotSupported,
37    #[error("failed to get registers: {0}")]
38    GetRegistersFailed(c_int),
39    #[error("failed to map memory: {0}")]
40    MMapfailed(c_int),
41    #[error("the start position of a mapping is past its end position")]
42    StartPositionPastEnd,
43    #[error("mapping too large to fit in memory")]
44    MappingTooLarge,
45    #[error("index was out of bounds")]
46    IndexOutOfBounds,
47    #[error("process_vm_readv failed: {0}")]
48    ProcessVmReadvFailed(c_int),
49    #[error("failed to peek at process data: {0}")]
50    PtracePeekDataFailed(c_int),
51    #[error("ProcessReader returned an error")]
52    ProcessReader(#[source] process_reader::ReadError),
53}