Authsignal Server SDKs can return errors for a variety of reasons, such as invalid requests or network interruptions, which should be handled accordingly.

const request = {
  userId: "dc58c6dc-a1fd-4a4f-8e2f-846636dd4833",
};

try {
  const response = await authsignal.getUser(request);
} catch (e) {
  if (e instanceof AuthsignalError) {
    const statusCode = e.statusCode;
    const errorCode = e.errorCode;
    const errorDescription = e.errorDescription;
  }
}

Error fields

statusCode
integer

The HTTP status code returned by the Authsignal Server API.

errorCode
string

A code which identifies a specific error state.

errorDescription
string

A free-text description of the error. This value should only be used for logging or troubleshooting purposes.

Error codes

invalid_configuration

Indicates that the request cannot be handled because the tenant is in an invalid configuration.

invalid_credential

Indicates that the credential (e.g. passkey) referenced by the request is invalid for the given user and cannot be authenticated.

invalid_request

Indicates that the request failed due to an invalid parameter or input.

too_many_requests

Indicates that the server cannot respond as requests have been rate-limited due to exceeding a threshold.

unauthorized

Indicates that the request is unauthorized due to invalid tenant credentials - for example if the API secret key is invalid or if the region doesn’t match.