-
Notifications
You must be signed in to change notification settings - Fork 4
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat!(gadget-sdk): add an Error type for executor module (#420)
* feat!(gadget-sdk): add an Error type for executor module We really shouldn't be using `Box<dyn Error>` anywhere in the SDK. * chore: clippy
- Loading branch information
1 parent
81e1f0e
commit 881e643
Showing
7 changed files
with
99 additions
and
77 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
use thiserror::Error; | ||
|
||
#[derive(Debug, Error)] | ||
pub enum Error { | ||
#[error("A process exited unexpectedly")] | ||
UnexpectedExit, | ||
#[error("Process {0} doesn't exist")] | ||
ProcessNotFound(sysinfo::Pid), | ||
#[error("Failed to focus on {0}, it does not exist")] | ||
ServiceNotFound(String), | ||
#[error("Expected {0} and found {1} running instead - process termination aborted")] | ||
ProcessMismatch(String, String), | ||
#[error("Failed to kill process, errno: {0}")] | ||
KillFailed(nix::errno::Errno), | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,5 @@ | ||
pub mod error; | ||
pub mod manager; | ||
pub(crate) mod types; | ||
pub(crate) mod utils; | ||
pub use error::Error; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters