Console ↗

NgilaError

Base class for failures returned by the JavaScript client. Use this to distinguish a client failure from an exception in application code.

Identification

Extends Error. Inspect the error class when handling a rejected request.

Handle in application code

import {NgilaError} from "./ngila.mjs";
try {
  await client.models();
} catch (error) {
  if (!(error instanceof NgilaError)) throw error;
  console.error(error.name);
}

Request rules and errors →