FaceCard Docs
SDK reference

FaceCardError

The error class every SDK call rejects with.

import { FaceCardError } from '@facecard/sdk';

try {
  await facecard.users.get('usr_missing');
} catch (err) {
  if (err instanceof FaceCardError) {
    console.log(err.code);    // 'not_found'
    console.log(err.status);  // 404
    console.log(err.message); // human readable text
  }
}
PropertyTypeDescription
codestringThe API error code, such as no_match, consent_required or rate_limited. See Errors.
statusnumberThe HTTP status of the response.
messagestringHuman readable text. Do not branch on it.

Branch on code.