Skip to content

Exit Codes

All hwledger CLI commands return standard exit codes.

CodeMeaningContextRecovery
0SuccessAll commandsN/A
1Generic errorAnyCheck stderr for details
2Invalid argumentsAllVerify command flags, run --help
3Resource not foundplan, probe, ingestCheck model exists, GPU connected
4Insufficient resourcesplan, runReduce context/batch, use quantization
5Network erroringest, fleet, runCheck internet connectivity, server URL
6Permission deniedfleet, auditCheck credentials, SSH key, mTLS cert
7Timeoutrun, fleetIncrease --timeout, check network latency
8Unsupportedplan, probeCheck hardware compatibility (e.g. CPU for CUDA model)
9Configuration errorAnyCheck ~/.config/hwledger/*.toml syntax
10Database errorfleet, auditCheck ~/.cache/hwledger/*.db permissions
11Cryptographic erroraudit, fleet (mTLS)Check certificates, key permissions
12Ledger integrity violationauditRun hwledger audit --verify for details

Usage in scripts

bash
#!/bin/bash
set -e  # Exit on any error

if ! hwledger plan --model llama-70b --context 32000; then
  case $? in
    3) echo "Model not found" ;;
    4) echo "Insufficient VRAM; try --quant int4" ;;
    8) echo "Unsupported GPU architecture" ;;
  esac
  exit 1
fi

Released under the Apache 2.0 License.