Skip to content

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

fix(x402): return typed unavailable error on legacy import failure

Steven Enamakelf2c5346cee46
diff --git a/crates/openhuman-core/src/modules/x402_service.rs b/crates/openhuman-core/src/modules/x402_service.rs
index 21c917b344..e216b3bf60 100644
--- a/crates/openhuman-core/src/modules/x402_service.rs
+++ b/crates/openhuman-core/src/modules/x402_service.rs
@@ -143,7 +143,9 @@ async fn ensure_service(
if !super::import_legacy_x402(&workspace).await {
// Opening the ledger without the earlier payments would restore the
// spending allowance; stay inactive and retry on the next call.
- anyhow::bail!("x402 legacy payment import failed; the service is not opened");
+ return Err(WalletCallError::Unavailable(
+ "x402 legacy payment import failed; the service is not opened".to_string(),
+ ));
}
let service_config = X402ConfigResponse {
workspace_dir: workspace.display().to_string(),