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
}
}| Property | Type | Description |
|---|---|---|
code | string | The API error code, such as no_match, consent_required or rate_limited. See Errors. |
status | number | The HTTP status of the response. |
message | string | Human readable text. Do not branch on it. |
Branch on code.