NylorunDocsBeta
Management APIAdmin SDK

Errors

The AdminError the Admin SDK throws, and its codes.

import { AdminError } from "@nylorun/admin";

try {
  await admin.keys.put("backend");
} catch (error) {
  if (error instanceof AdminError && error.code === "key_role_mismatch") {
    // an application key was sent to the Management API
  }
  throw error;
}

Every failure is an AdminError.

FieldTypePurpose
codeErrorCodeThe cause, from the error registry
statusnumber | undefinedThe HTTP status, when the Runtime answered
detailsunknownExtra data from the Runtime

Codes

CodeCause
connection_missingNo URL and management key resolved
incompatible_hostThe Runtime does not serve protocol 8 with the Management API
key_role_mismatchAn application key was sent to the Management API (403)
subject_invalidA management key was sent with Nylorun-Subject or Nylorun-Scopes (403)
origin_rejectedA key was sent from a browser (403)

Other codes come from the Runtime and are listed on each endpoint page.

On this page