Merge pull request #553 from matthiasbeyer/libimagstore/custom-hook-error-data-interface
Add interface for custom error data type
This commit is contained in:
commit
2a95d4f79d
1 changed files with 21 additions and 0 deletions
|
@ -1,4 +1,6 @@
|
|||
use std::convert::Into;
|
||||
use std::default::Default;
|
||||
|
||||
generate_error_imports!();
|
||||
|
||||
generate_custom_error_types!(HookError, HookErrorKind, CustomData,
|
||||
|
@ -12,6 +14,25 @@ pub struct CustomData {
|
|||
aborting: bool,
|
||||
}
|
||||
|
||||
impl CustomData {
|
||||
|
||||
pub fn aborting(mut self, b: bool) -> CustomData {
|
||||
self.aborting = b;
|
||||
self
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
impl Default for CustomData {
|
||||
|
||||
fn default() -> CustomData {
|
||||
CustomData {
|
||||
aborting: true
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
impl HookError {
|
||||
|
||||
pub fn is_aborting(&self) -> bool {
|
||||
|
|
Loading…
Reference in a new issue