Skip to content

The fastest, cheapest, most efficient open-source agent harness. Run more than 500 agents on a $10 VPS.

feat(caps_host): add error type for capability host

Steven Enamakel690ffdfac0d3
diff --git a/crates/openhuman-core/src/flows/caps_host/error.rs b/crates/openhuman-core/src/flows/caps_host/error.rs
new file mode 100644
index 0000000000..78b127fdbf
--- /dev/null
+++ b/crates/openhuman-core/src/flows/caps_host/error.rs
@@ -0,0 +1,34 @@
+//! Errors returned by the host-owned capability adapters.
+
+use std::fmt;
+
+#[derive(Debug)]
+pub(crate) enum CapsError {
+ Capability(String),
+}
+
+pub(crate) type EngineError = CapsError;
+
+impl fmt::Display for CapsError {
+ fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
+ match self {
+ Self::Capability(message) => f.write_str(message),
+ }
+ }
+}
+
+impl std::error::Error for CapsError {}
+
+pub(crate) type Result<T> = std::result::Result<T, CapsError>;
+
+impl From<String> for CapsError {
+ fn from(message: String) -> Self {
+ Self::Capability(message)
+ }
+}
+
+impl From<&str> for CapsError {
+ fn from(message: &str) -> Self {
+ Self::Capability(message.to_owned())
+ }
+}