For the complete documentation index, see llms.txt. You can also append .md to any page URL to get its markdown version.
Skip to main content
For the complete documentation index, see llms.txt.

For the complete documentation index, see llms.txt

Error handling

Every SDK operation reports failures as a SignicatOIDCException. Coroutine calls result in this exception; callback calls deliver it to onError.

Exception reference​

The SignicatOIDCException includes a stable error code, in addition to any protocol details that the Signicat service returned.

You should decide how your app responds to errors based on errorCode rather than on the error message text. Error codes are part of the SDK contract, whereas messages are not.

Do not show raw errors to end-users

Use error messages and OAuth descriptions to diagnose problems. Show end-users a message based on the error code.

For an overview of the exception properties, see the table below:

Example: Respond to error codes
try {
val session = client.login()
showLoggedInScreen(session)
} catch (error: SignicatOIDCException) {
when (error.errorCode) {
SignicatOIDCException.ErrorCode.authorizationCancelled -> showLoginScreen()
SignicatOIDCException.ErrorCode.noSupportedBrowser -> showInstallBrowserMessage()
SignicatOIDCException.ErrorCode.sessionExpired -> startLoginAgain()
else -> showGenericError()
}
}

Error codes​

For an overview of possible error codes, see the table below:

Log error detail​

The toJson() method serialises the non-null error details into a compact JSON object. It always includes code and message, and adds the OAuth fields when the Signicat service provided them.

You can use this for diagnostics and support tickets.

Example: Serialise an error for logging
catch (error: SignicatOIDCException) {
Log.e("MyApp", error.toJson())
}
Example: Serialised error
{
"code": "tokenExchangeFailed",
"message": "OIDC token exchange failed.",
"oauthError": "invalid_grant",
"oauthErrorDescription": "The authorization code is invalid or has expired."
}

Support​

If you need help or want to report an issue, contact us by creating a support ticket in the Signicat Dashboard.

Include serialised error detail

When creating a support ticket, you should include the serialised error details from the toJson() method.