Error reference

Stable error codes returned by the DeviceSDK API and CLI

DeviceSDK API responses use a { success: false, error, code, docs } shape on every error path. The code is a stable identifier suitable for === comparison; the docs URL points to a page on this site explaining the error and the most common fix.

The CLI surfaces the same fields on DeviceSDKApiError instances:

import { DeviceSDKApiError } from "@devicesdk/cli";
try { /* ... */ }
catch (err) {
  if (err instanceof DeviceSDKApiError) {
    console.error(err.message);
    if (err.code === "invalid_token") await login();
    if (err.docs) console.error(`See ${err.docs}`);
  }
}

Error codes

If you hit an error code that isn’t listed here, please open an issue so we can document it.