Skip to main content
This section outlines the Quepass SDK’s error handling, session management, and capabilities. It defines common error codes like 200 (Success), 400 (Bad Request), 401 (Unauthorized), 403 (Forbidden), 404 (Not Found), and 500 (Server Error). The SDK allows checking for expired sessions and re-initializing them, and developers can use the SDKBuilder to retrieve available SDK capabilities.
Error KeyUser-facing MessageWhen TriggeredError Code
CRYPTOGRAPHIC_ERRORA security issue occurred. Please try again.RSA handshake or payload encryption/decryption failed.400
SESSION_ERRORWe couldn’t load your session. Please try again.Session ID or token is missing, expired, or invalid.400
INVALID_REQUESTSomething’s wrong with the request. Please try again.The API received a malformed or incomplete request payload.400
INVALID_CONFIGURATIONSystem setup error. Please try again.Channel configuration is missing or misconfigured on the backend.400
TIMEOUTRequest timed out. Please try again.The backend did not respond within the expected time window.408
DB_ERRORSomething went wrong. Please try again.A database-level error occurred on the backend.500
ENGINE_ERRORSystem error. Please try again.The biometric or document processing engine encountered an error.500
INTERNAL_ERRORAn unexpected error occurred.An unhandled exception on the backend or in the SDK pipeline.500
INVALID_OPERATIONPlease scan again.Operation not permitted in the current state (e.g. invalid QR re-scan).400
INVALID_DATAPlease check your input and try again.Provided data failed validation — document number format, image quality, etc.400
SDK_INTERNAL_ERRORSDK Internal Error.init() was not called or failed before a data method was invoked.400
UNAUTHORIZED_ACCESSUnauthorized access. Please login again.Authentication failed due to invalid credentials, expired token, or missing authorization header.401
JOURNEY_ERRORUnable to complete the verification journey. Please try again.The verification journey failed due to an invalid state transition or backend journey processing issue.400

1. Error Handling

Errors can be accessed using the Quepass SDK from the errors array (code, message, details) or directly from the response data using the "message" field.
// From errors array     
    output.errors?.first?.code     
    output.errors?.first?.message     
    output.errors?.first?.details     
          
    // Or from data     
    output.data?["message"] as? String     

2. Session Handling

Use the Quepass SDK’s session-handling methods to check for expired sessions with isSessionExpired() and re-initialize the SDK using reInitialize() when needed.
if (KycSdk.isSessionExpired()) { 
    KycSdk.reInitialize() 
} 

3. SDK Capabilities

Use the Quepass SDK to retrieve available SDK capabilities by building an SDKBuilder with FunctionType.GET_SDK_CAPABILITIES. The sdkGeneralHandler receives the response containing capability information, which can then be launched using the Launcher.
val sdkBuilder = SDKBuilder.builder() 
    .functionType(FunctionType.GET_SDK_CAPABILITIES) 
    .sdkGeneralHandler { response -> 
        // capability information 
    }.build() 
 
Launcher.launch(sdkBuilder, context)