
Loading...

Loading...
Reference · Errors
Paste any thrown error or raw on-chain revert data: get a structured remediation - what happened, whether your LCAI is safe, whether to retry, and the exact next step. Pure SDK helpers (explainInferenceError + decodeWorkerError), runs in your browser, no wallet.
import { explainInferenceError, decodeWorkerError } from "lightnode-sdk";
try {
await runInferenceWithKey({ network, privateKey, prompt });
} catch (e) {
const x = explainInferenceError(e, { refundWindowSec });
// x.kind, x.fundsSafe, x.retryable, x.nextStep - no message-string regexing
if (x.retryable) retry();
}
// or decode a raw on-chain revert into a named contract error:
decodeWorkerError("0x592f994b...").message;