Error Handling & Troubleshooting
Best practices for error handling and troubleshooting
When using the DICE ID SDK, developers may encounter various errors, exceptions, and error codes. Here is a comprehensive list of possible issues and suggested best practices for error handling and troubleshooting:
Network Errors:
Connection timeout: Handle this error by checking the network connectivity and retrying the operation if necessary.
DNS resolution failure: Verify the DNS configuration and ensure that the host is reachable. Retry the operation or notify the user about the issue.
Authentication and Authorization Errors:
Invalid credentials: Ensure that the provided authentication credentials (e.g., wallet token) are correct and up to date.
Insufficient privileges: Check the user's access level and permissions. Ensure that the user has the necessary privileges to perform the requested operation.
Data Validation Errors:
Invalid input data: Validate the input data before processing to ensure it meets the required format and constraints.
Missing or incomplete data: Handle situations where required data is missing or incomplete gracefully, and prompt the user to provide the necessary information.
Server-side Errors:
Internal server error (HTTP 500): Notify the DICE ID service provider about the issue and retry the operation after some time.
Service unavailable (HTTP 503): Retry the operation after a delay. If the issue persists, contact the DICE ID service provider for support.
Possible Error Messages & Troubleshooting Steps
Not able to create wallet
Validate the API key: Double-check that the API key being used is valid and has not expired. Obtain a new API key if needed from the appropriate source.
Verify permissions: Make sure the API key used has the necessary permissions to create wallets.
Confirm wallet name and key: Ensure that you have entered the wallet name and key accurately. Any typos or incorrect information can cause the wallet creation to fail.
Error creating schema:
Check your network connection: Ensure that you have a stable internet connection and try again.
Validate the API key: Confirm that the API key used for the schema creation is valid and has not expired. If needed, obtain a new API key from the appropriate source.
Verify permissions: Ensure that the API key has the necessary permissions to create schemas. Review the documentation or contact the provider for information on required permissions.
Failed to create connection invitation
Validate the API key: Confirm that the API key being used is valid and has not expired.
Check network connectivity: Ensure that you have a stable internet connection and try creating the connection invitation again.
Verify input parameters: Double-check that all the required input parameters, such as
invitationInput
, are provided accurately. Ensure that there are no typos or missing values.
Failed to issue credential
Validate the API key: Confirm that the API key being used is valid and has not expired. Obtain a new API key if needed from the appropriate source.
Verify the connection ID: Double-check that the
ISSUER_CONNECTION_ID
provided is correct and corresponds to a valid connection established with the recipient.Validate the credential definition: Ensure that the
CREDENTIAL_DEF
variable accurately points to a valid credential definition that matches the intended credential type.Verify the credential values: Check the
cred_def_values
array to ensure that the attribute names and corresponding values are accurately provided. Ensure that the required attributes are included and match the expected format.
Error in template creation
Validate the API key: Confirm that the API key (
VERIFIER_XAPIKEY
) being used is valid and has not expired. Obtain a new API key if needed from the appropriate source.Verify the attribute values: Double-check the attribute names, filter names, and filter values provided in the
templ_data
array. Ensure they match the expected format and adhere to any guidelines or restrictions specified.Check for syntax or formatting errors: Review the code for any syntax errors or missing parentheses, commas, or quotation marks that could cause issues with the function call.
Error sending presentation
Validate the API key: Confirm that the API key (
VERIFIER_XAPIKEY
) being used is valid and has not expired. Obtain a new API key if needed from the appropriate source.Verify the connection and template IDs: Double-check the verifier connection ID and verifier template ID to ensure they are correctly assigned and correspond to existing connections and templates.
Error getting state
Verify the presentation exchange ID: Double-check the presentation exchange ID (
PRESENTATION_EX_ID
) to ensure it is correctly assigned and corresponds to an existing presentation exchange.Check for syntax or formatting errors: Review the code for any syntax errors or missing parentheses, commas, or quotation marks that could cause issues with the function call.
Verify the network connection: Ensure that you have a stable internet connection and that there are no network disruptions that could interfere with retrieving the verification state.
Last updated