aboutsummaryrefslogtreecommitdiffhomepage
path: root/crates/shirabe-symfony-filesystem/src/exception
diff options
context:
space:
mode:
Diffstat (limited to 'crates/shirabe-symfony-filesystem/src/exception')
-rw-r--r--crates/shirabe-symfony-filesystem/src/exception/io_exception.rs29
1 files changed, 29 insertions, 0 deletions
diff --git a/crates/shirabe-symfony-filesystem/src/exception/io_exception.rs b/crates/shirabe-symfony-filesystem/src/exception/io_exception.rs
new file mode 100644
index 00000000..07a189c3
--- /dev/null
+++ b/crates/shirabe-symfony-filesystem/src/exception/io_exception.rs
@@ -0,0 +1,29 @@
+//! ref: composer/vendor/symfony/filesystem/Exception/IOException.php
+
+use shirabe_php_shim::RuntimeException;
+
+#[derive(Debug)]
+pub struct IOException {
+ inner: RuntimeException,
+ pub path: Option<String>,
+}
+
+impl IOException {
+ pub fn new(
+ message: String,
+ code: i64,
+ previous: Option<std::sync::Arc<anyhow::Error>>,
+ path: Option<String>,
+ ) -> Self {
+ Self {
+ inner: RuntimeException::with_code_and_previous(message, code, previous),
+ path,
+ }
+ }
+}
+
+shirabe_php_shim::impl_php_exception!(
+ IOException,
+ inner,
+ r"Symfony\Component\Filesystem\Exception\IOException"
+);