diff options
Diffstat (limited to 'crates/shirabe-external-packages/src/symfony/component/console/exception')
4 files changed, 30 insertions, 0 deletions
diff --git a/crates/shirabe-external-packages/src/symfony/component/console/exception/command_not_found_exception.rs b/crates/shirabe-external-packages/src/symfony/component/console/exception/command_not_found_exception.rs new file mode 100644 index 0000000..f1ed60b --- /dev/null +++ b/crates/shirabe-external-packages/src/symfony/component/console/exception/command_not_found_exception.rs @@ -0,0 +1,13 @@ +#[derive(Debug)] +pub struct CommandNotFoundException { + pub message: String, + pub code: i64, +} + +impl std::fmt::Display for CommandNotFoundException { + fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { + write!(f, "{}", self.message) + } +} + +impl std::error::Error for CommandNotFoundException {} diff --git a/crates/shirabe-external-packages/src/symfony/component/console/exception/exception_interface.rs b/crates/shirabe-external-packages/src/symfony/component/console/exception/exception_interface.rs new file mode 100644 index 0000000..3c42009 --- /dev/null +++ b/crates/shirabe-external-packages/src/symfony/component/console/exception/exception_interface.rs @@ -0,0 +1 @@ +pub trait ExceptionInterface: std::error::Error {} diff --git a/crates/shirabe-external-packages/src/symfony/component/console/exception/invalid_argument_exception.rs b/crates/shirabe-external-packages/src/symfony/component/console/exception/invalid_argument_exception.rs new file mode 100644 index 0000000..658ed8c --- /dev/null +++ b/crates/shirabe-external-packages/src/symfony/component/console/exception/invalid_argument_exception.rs @@ -0,0 +1,13 @@ +#[derive(Debug)] +pub struct InvalidArgumentException { + pub message: String, + pub code: i64, +} + +impl std::fmt::Display for InvalidArgumentException { + fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { + write!(f, "{}", self.message) + } +} + +impl std::error::Error for InvalidArgumentException {} diff --git a/crates/shirabe-external-packages/src/symfony/component/console/exception/mod.rs b/crates/shirabe-external-packages/src/symfony/component/console/exception/mod.rs new file mode 100644 index 0000000..febda79 --- /dev/null +++ b/crates/shirabe-external-packages/src/symfony/component/console/exception/mod.rs @@ -0,0 +1,3 @@ +pub mod command_not_found_exception; +pub mod exception_interface; +pub mod invalid_argument_exception; |
