nelieo-nsp SDK is a subclass of NSPError. Catching the right exception at the right level lets you distinguish between transient network failures, authentication problems, missing apps, and application-level action failures — and handle each one appropriately.
Exception Hierarchy
Base Error Fields
EveryNSPError subclass exposes these three attributes:
Exception Reference
NSPConnectionError — Daemon unreachable
NSPConnectionError — Daemon unreachable
When raised: The daemon is not running, is not listening on the configured host and port, or an existing connection was dropped during a request.HTTP status: 0 (no HTTP response received)Fields:Common causes:
e.message— description of the connection failuree.code—"connection_refused"or"connection_reset"e.status_code—0
- Daemon not started
NSP_PORTdoes not matchAXON_SERVER__PORTin your daemon config- Firewall rule blocking localhost connections
NSPAuthError — Invalid or missing API key
NSPAuthError — Invalid or missing API key
When raised: The API key is absent, malformed, expired, or has been disabled on the daemon.HTTP status: 401Fields:Generate a fresh key and set it as an environment variable or pass it to
e.message— human-readable auth failure descriptione.code— one of"missing_key","invalid_key","disabled_key"e.status_code—401
NSPClient(api_key=...).NSPNotFoundError — App or PID not tracked
NSPNotFoundError — App or PID not tracked
When raised: The app name,
app_id, or PID you requested does not exist in the daemon’s tracked list.HTTP status: 404Fields:e.message— which resource was not founde.code—"app_not_found"or"pid_not_found"e.status_code—404
NSPRateLimitError — Too many requests
NSPRateLimitError — Too many requests
When raised: You have exceeded the daemon’s per-key rate limit for state reads or action dispatches.HTTP status: 429Fields:Default limits: 100 state reads/sec and 10 actions/sec per API key. Adjust in
e.message— rate limit descriptione.code—"rate_limit_exceeded"e.status_code—429e.retry_after—float— minimum seconds to wait before retrying
axon.toml.NSPTimeoutError — Request or probe timed out
NSPTimeoutError — Request or probe timed out
When raised: A request exceeded
NSPClient’s timeout setting, or a fresh probe cycle did not complete within the daemon’s probe timeout.HTTP status: 504Fields:e.message— what timed oute.code—"request_timeout"or"probe_timeout"e.status_code—504
NSPConfidenceTooLowError — Probe not ready
NSPConfidenceTooLowError — Probe not ready
When raised: The probe’s confidence score is below the minimum required to execute the requested action. This prevents the SDK from acting on stale or incomplete state.HTTP status: 422Fields:
e.message— description including current and required confidencee.code—"confidence_too_low"e.status_code—422e.current_confidence—float— the probe’s current scoree.required_confidence—float— minimum score needed
- The app was just detected and the first probe is not yet complete
- The app navigated to a new view and confidence dropped temporarily
- A native app with inherently variable confidence
NSPActionError — Action failed at the application level
NSPActionError — Action failed at the application level
When raised: The action was dispatched to the runtime but failed — either because the application rejected it, the action’s internal logic errored, or post-action verification did not pass.Fields:
e.message— human-readable failure descriptione.code— machine-readable error code (e.g."clr_invoke_timeout","verification_failed")e.action—str— name of the action that failede.verification_failed—bool—Trueif the action ran butverify_expressionreturned falsy
NSPIrreversibleNotConfirmedError — Missing verify=True
NSPIrreversibleNotConfirmedError — Missing verify=True
When raised: You called
session.execute() on an IrreversibleWrite action without explicitly setting verify=True. The SDK enforces this check locally before sending any request to the daemon — no network round-trip is wasted.Fields:e.message— explanation of why the call was rejectede.code—"irreversible_not_confirmed"e.action—str— name of the irreversible action
