aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--Cargo.lock1
-rw-r--r--Cargo.toml8
-rw-r--r--examples/example-async/Cargo.lock21
-rw-r--r--examples/example-basic/Cargo.lock21
-rw-r--r--examples/example-completion/Cargo.lock21
-rw-r--r--examples/example-dispatch-tree/Cargo.lock21
-rw-r--r--examples/example-exit-code/Cargo.lock21
-rw-r--r--examples/example-general-renderer/Cargo.lock21
-rw-r--r--examples/example-picker/Cargo.lock21
-rw-r--r--mingling_core/Cargo.toml1
-rw-r--r--mingling_core/src/asset/chain/error.rs29
-rw-r--r--mingling_core/src/program/error.rs2
-rw-r--r--mingling_core/src/program/exec/error.rs70
13 files changed, 85 insertions, 173 deletions
diff --git a/Cargo.lock b/Cargo.lock
index c3c399b..f9f2ff1 100644
--- a/Cargo.lock
+++ b/Cargo.lock
@@ -310,7 +310,6 @@ dependencies = [
"serde",
"serde_json",
"serde_yaml",
- "thiserror",
"toml",
]
diff --git a/Cargo.toml b/Cargo.toml
index 916fc3b..8037fd6 100644
--- a/Cargo.toml
+++ b/Cargo.toml
@@ -14,20 +14,24 @@ exclude = [
[workspace.dependencies]
just_fmt = "0.1.2"
+just_template = "0.1.3"
once_cell = "1.21.4"
-thiserror = "2"
+
serde = { version = "1.0", features = ["derive"] }
serde_json = "1"
serde_yaml = "0.9"
toml = "1.1.2"
ron = "0.12.1"
+
dirs = "6"
+
syn = { version = "2.0", features = ["full", "visit-mut"] }
quote = "1.0"
proc-macro2 = "1.0"
+
colored = "3.1.1"
tokio = { version = "1", features = ["full"] }
-just_template = "0.1.3"
+
log = "0.4"
env_logger = "0.11"
diff --git a/examples/example-async/Cargo.lock b/examples/example-async/Cargo.lock
index b8d51ff..d1c2abb 100644
--- a/examples/example-async/Cargo.lock
+++ b/examples/example-async/Cargo.lock
@@ -73,7 +73,6 @@ version = "0.1.8"
dependencies = [
"just_fmt",
"once_cell",
- "thiserror",
]
[[package]]
@@ -204,26 +203,6 @@ dependencies = [
]
[[package]]
-name = "thiserror"
-version = "2.0.18"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "4288b5bcbc7920c07a1149a35cf9590a2aa808e0bc1eafaade0b80947865fbc4"
-dependencies = [
- "thiserror-impl",
-]
-
-[[package]]
-name = "thiserror-impl"
-version = "2.0.18"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "ebc4ee7f67670e9b64d05fa4253e753e016c6c95ff35b89b7941d6b856dec1d5"
-dependencies = [
- "proc-macro2",
- "quote",
- "syn",
-]
-
-[[package]]
name = "tokio"
version = "1.52.1"
source = "registry+https://github.com/rust-lang/crates.io-index"
diff --git a/examples/example-basic/Cargo.lock b/examples/example-basic/Cargo.lock
index 48f5240..e09c178 100644
--- a/examples/example-basic/Cargo.lock
+++ b/examples/example-basic/Cargo.lock
@@ -29,7 +29,6 @@ version = "0.1.8"
dependencies = [
"just_fmt",
"once_cell",
- "thiserror",
]
[[package]]
@@ -79,26 +78,6 @@ dependencies = [
]
[[package]]
-name = "thiserror"
-version = "2.0.18"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "4288b5bcbc7920c07a1149a35cf9590a2aa808e0bc1eafaade0b80947865fbc4"
-dependencies = [
- "thiserror-impl",
-]
-
-[[package]]
-name = "thiserror-impl"
-version = "2.0.18"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "ebc4ee7f67670e9b64d05fa4253e753e016c6c95ff35b89b7941d6b856dec1d5"
-dependencies = [
- "proc-macro2",
- "quote",
- "syn",
-]
-
-[[package]]
name = "unicode-ident"
version = "1.0.24"
source = "registry+https://github.com/rust-lang/crates.io-index"
diff --git a/examples/example-completion/Cargo.lock b/examples/example-completion/Cargo.lock
index 8923a98..1bde85a 100644
--- a/examples/example-completion/Cargo.lock
+++ b/examples/example-completion/Cargo.lock
@@ -40,7 +40,6 @@ dependencies = [
"just_fmt",
"just_template",
"once_cell",
- "thiserror",
]
[[package]]
@@ -96,26 +95,6 @@ dependencies = [
]
[[package]]
-name = "thiserror"
-version = "2.0.18"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "4288b5bcbc7920c07a1149a35cf9590a2aa808e0bc1eafaade0b80947865fbc4"
-dependencies = [
- "thiserror-impl",
-]
-
-[[package]]
-name = "thiserror-impl"
-version = "2.0.18"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "ebc4ee7f67670e9b64d05fa4253e753e016c6c95ff35b89b7941d6b856dec1d5"
-dependencies = [
- "proc-macro2",
- "quote",
- "syn",
-]
-
-[[package]]
name = "unicode-ident"
version = "1.0.24"
source = "registry+https://github.com/rust-lang/crates.io-index"
diff --git a/examples/example-dispatch-tree/Cargo.lock b/examples/example-dispatch-tree/Cargo.lock
index ed1c6f1..735cb8b 100644
--- a/examples/example-dispatch-tree/Cargo.lock
+++ b/examples/example-dispatch-tree/Cargo.lock
@@ -39,7 +39,6 @@ dependencies = [
"just_fmt",
"just_template",
"once_cell",
- "thiserror",
]
[[package]]
@@ -89,26 +88,6 @@ dependencies = [
]
[[package]]
-name = "thiserror"
-version = "2.0.18"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "4288b5bcbc7920c07a1149a35cf9590a2aa808e0bc1eafaade0b80947865fbc4"
-dependencies = [
- "thiserror-impl",
-]
-
-[[package]]
-name = "thiserror-impl"
-version = "2.0.18"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "ebc4ee7f67670e9b64d05fa4253e753e016c6c95ff35b89b7941d6b856dec1d5"
-dependencies = [
- "proc-macro2",
- "quote",
- "syn",
-]
-
-[[package]]
name = "unicode-ident"
version = "1.0.24"
source = "registry+https://github.com/rust-lang/crates.io-index"
diff --git a/examples/example-exit-code/Cargo.lock b/examples/example-exit-code/Cargo.lock
index efe8f6e..4759650 100644
--- a/examples/example-exit-code/Cargo.lock
+++ b/examples/example-exit-code/Cargo.lock
@@ -29,7 +29,6 @@ version = "0.1.8"
dependencies = [
"just_fmt",
"once_cell",
- "thiserror",
]
[[package]]
@@ -79,26 +78,6 @@ dependencies = [
]
[[package]]
-name = "thiserror"
-version = "2.0.18"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "4288b5bcbc7920c07a1149a35cf9590a2aa808e0bc1eafaade0b80947865fbc4"
-dependencies = [
- "thiserror-impl",
-]
-
-[[package]]
-name = "thiserror-impl"
-version = "2.0.18"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "ebc4ee7f67670e9b64d05fa4253e753e016c6c95ff35b89b7941d6b856dec1d5"
-dependencies = [
- "proc-macro2",
- "quote",
- "syn",
-]
-
-[[package]]
name = "unicode-ident"
version = "1.0.24"
source = "registry+https://github.com/rust-lang/crates.io-index"
diff --git a/examples/example-general-renderer/Cargo.lock b/examples/example-general-renderer/Cargo.lock
index 6808db5..213a0db 100644
--- a/examples/example-general-renderer/Cargo.lock
+++ b/examples/example-general-renderer/Cargo.lock
@@ -79,7 +79,6 @@ dependencies = [
"serde",
"serde_json",
"serde_yaml",
- "thiserror",
"toml",
]
@@ -221,26 +220,6 @@ dependencies = [
]
[[package]]
-name = "thiserror"
-version = "2.0.18"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "4288b5bcbc7920c07a1149a35cf9590a2aa808e0bc1eafaade0b80947865fbc4"
-dependencies = [
- "thiserror-impl",
-]
-
-[[package]]
-name = "thiserror-impl"
-version = "2.0.18"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "ebc4ee7f67670e9b64d05fa4253e753e016c6c95ff35b89b7941d6b856dec1d5"
-dependencies = [
- "proc-macro2",
- "quote",
- "syn",
-]
-
-[[package]]
name = "toml"
version = "1.1.2+spec-1.1.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
diff --git a/examples/example-picker/Cargo.lock b/examples/example-picker/Cargo.lock
index 94de2f7..95e6d96 100644
--- a/examples/example-picker/Cargo.lock
+++ b/examples/example-picker/Cargo.lock
@@ -31,7 +31,6 @@ version = "0.1.8"
dependencies = [
"just_fmt",
"once_cell",
- "thiserror",
]
[[package]]
@@ -93,26 +92,6 @@ dependencies = [
]
[[package]]
-name = "thiserror"
-version = "2.0.18"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "4288b5bcbc7920c07a1149a35cf9590a2aa808e0bc1eafaade0b80947865fbc4"
-dependencies = [
- "thiserror-impl",
-]
-
-[[package]]
-name = "thiserror-impl"
-version = "2.0.18"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "ebc4ee7f67670e9b64d05fa4253e753e016c6c95ff35b89b7941d6b856dec1d5"
-dependencies = [
- "proc-macro2",
- "quote",
- "syn",
-]
-
-[[package]]
name = "tokio"
version = "1.52.1"
source = "registry+https://github.com/rust-lang/crates.io-index"
diff --git a/mingling_core/Cargo.toml b/mingling_core/Cargo.toml
index 166e0d5..118813c 100644
--- a/mingling_core/Cargo.toml
+++ b/mingling_core/Cargo.toml
@@ -28,7 +28,6 @@ debug = ["dep:log", "dep:env_logger"]
[dependencies]
just_fmt.workspace = true
-thiserror.workspace = true
once_cell.workspace = true
dirs = { workspace = true, optional = true }
diff --git a/mingling_core/src/asset/chain/error.rs b/mingling_core/src/asset/chain/error.rs
index e5c753d..39e4f62 100644
--- a/mingling_core/src/asset/chain/error.rs
+++ b/mingling_core/src/asset/chain/error.rs
@@ -1,12 +1,33 @@
use crate::error::ProgramInternalExecuteError;
-#[derive(thiserror::Error, Debug)]
+#[derive(Debug)]
pub enum ChainProcessError {
- #[error("Other error: {0}")]
Other(String),
+ IO(std::io::Error),
+}
+
+impl std::fmt::Display for ChainProcessError {
+ fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
+ match self {
+ ChainProcessError::Other(s) => write!(f, "Other error: {}", s),
+ ChainProcessError::IO(e) => write!(f, "IO error: {}", e),
+ }
+ }
+}
- #[error("IO error: {0}")]
- IO(#[from] std::io::Error),
+impl std::error::Error for ChainProcessError {
+ fn source(&self) -> Option<&(dyn std::error::Error + 'static)> {
+ match self {
+ ChainProcessError::IO(e) => Some(e),
+ ChainProcessError::Other(_) => None,
+ }
+ }
+}
+
+impl From<std::io::Error> for ChainProcessError {
+ fn from(e: std::io::Error) -> Self {
+ ChainProcessError::IO(e)
+ }
}
impl From<ProgramInternalExecuteError> for ChainProcessError {
diff --git a/mingling_core/src/program/error.rs b/mingling_core/src/program/error.rs
index a6874cf..03e9af6 100644
--- a/mingling_core/src/program/error.rs
+++ b/mingling_core/src/program/error.rs
@@ -1,9 +1,7 @@
use std::any::Any;
use std::fmt;
-use thiserror::Error;
/// Error type returned when a panic occurs during execution.
-#[derive(Error)]
pub struct ProgramPanic {
pub payload: Box<dyn Any + Send>,
}
diff --git a/mingling_core/src/program/exec/error.rs b/mingling_core/src/program/exec/error.rs
index 2d806dc..2790a7b 100644
--- a/mingling_core/src/program/exec/error.rs
+++ b/mingling_core/src/program/exec/error.rs
@@ -1,33 +1,71 @@
use crate::error::{ChainProcessError, ProgramPanic};
+use std::fmt;
-#[derive(thiserror::Error, Debug)]
+#[derive(Debug)]
pub enum ProgramExecuteError {
- #[error("No Dispatcher Found")]
DispatcherNotFound,
-
- #[error("No Renderer (`{0}`) Found")]
RendererNotFound(String),
+ Panic(ProgramPanic),
+ Other(String),
+}
- #[error("Panic: {0:?}")]
- Panic(#[from] ProgramPanic),
+impl fmt::Display for ProgramExecuteError {
+ fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
+ match self {
+ ProgramExecuteError::DispatcherNotFound => write!(f, "No Dispatcher Found"),
+ ProgramExecuteError::RendererNotFound(s) => {
+ write!(f, "No Renderer (`{}`) Found", s)
+ }
+ ProgramExecuteError::Panic(p) => write!(f, "Panic: {:?}", p),
+ ProgramExecuteError::Other(s) => write!(f, "Other error: {}", s),
+ }
+ }
+}
- #[error("Other error: {0}")]
- Other(String),
+impl std::error::Error for ProgramExecuteError {}
+
+impl From<ProgramPanic> for ProgramExecuteError {
+ fn from(value: ProgramPanic) -> Self {
+ ProgramExecuteError::Panic(value)
+ }
}
-#[derive(thiserror::Error, Debug)]
+#[derive(Debug)]
pub enum ProgramInternalExecuteError {
- #[error("No Dispatcher Found")]
DispatcherNotFound,
-
- #[error("No Renderer (`{0}`) Found")]
RendererNotFound(String),
-
- #[error("Other error: {0}")]
Other(String),
+ IO(std::io::Error),
+}
- #[error("IO error: {0}")]
- IO(#[from] std::io::Error),
+impl fmt::Display for ProgramInternalExecuteError {
+ fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
+ match self {
+ ProgramInternalExecuteError::DispatcherNotFound => {
+ write!(f, "No Dispatcher Found")
+ }
+ ProgramInternalExecuteError::RendererNotFound(s) => {
+ write!(f, "No Renderer (`{}`) Found", s)
+ }
+ ProgramInternalExecuteError::Other(s) => write!(f, "Other error: {}", s),
+ ProgramInternalExecuteError::IO(e) => write!(f, "IO error: {}", e),
+ }
+ }
+}
+
+impl std::error::Error for ProgramInternalExecuteError {
+ fn source(&self) -> Option<&(dyn std::error::Error + 'static)> {
+ match self {
+ ProgramInternalExecuteError::IO(e) => Some(e),
+ _ => None,
+ }
+ }
+}
+
+impl From<std::io::Error> for ProgramInternalExecuteError {
+ fn from(e: std::io::Error) -> Self {
+ ProgramInternalExecuteError::IO(e)
+ }
}
impl From<ProgramInternalExecuteError> for ProgramExecuteError {