Debugging & Error Handling
Arc402’s SDK includes built-in tools for debugging and error handling, giving developers insight into how signals move through the system and how AI decisions are generated. You can trace signal paths, inspect adaptive responses, and validate proof-of-decision outputs, making it easier to understand what happens at each step.
These tools let you monitor data flow, verify encrypted proofs, and handle errors gracefully, ensuring that applications stay reliable even in unexpected scenarios.
import { Arc402 } from "arc402-sdk";
const arc = new Arc402({ apiKey: process.env.ARC402_API_KEY });
try {
const result = await arc.submitSignal({ type: "testAction", payload: { value: 42 } });
console.log("Signal processed successfully:", result);
const proof = await arc.verifyDecision(result.id);
console.log("Decision proof is valid:", proof.valid);
} catch (error) {
console.error("Encountered an error while processing the signal:", error.message);
}
In this example, you can send a signal, check its processing, and confirm the resulting proof. Errors are caught and logged, giving you clear visibility into the system and making it easier to troubleshoot and refine your integration.
Last updated