Error Handling / Debugging
This article explains how errors are returned using the HYPR SDK.
SDK for Android
HyprStatusResult
is similar to a linked list. Each node represents a level where the error could have occurred. That level is specified by the StatusType
.
FIDO_SERVER -> HYPR_SERVER_RP -> HYPR_UI_ADAPTER -> HYPR_USER_AGENT -> FIDO_CLIENT -> FIDO_ASM -> FIDO_AUTHENTICATOR_TLV
HyprStatusResult
Errors are returned back to an activity via the onActivityResult
override method inside of HyprStatusResult
.
First check to see if the Extra
exists in the Intent data returned back to the calling activity from the HYPR Activity launched via a HyprApiActionAdatper
method call, then cast to the HyprStatusResult
object.
Once you have this object, then you can get the Display Code, Display Text, and other various attributes such as displaying the class toString()
which will give an integrating developer the full Error Trace that is required to debug issues.
@Override
protected void onActivityResult(int requestCode,
int resultCode,
Intent data) {
if (data != null && data.hasExtra(INTENT_KEY_HYPR_STATUS_RESULT)) {
HyprStatusResult statusResult = (HyprStatusResult) data.getSerializableExtra(INTENT_KEY_HYPR_STATUS_RESULT);
if (statusResult != null) {
// Display Error and Display Text can be shown to the end user
int displayErrorCode = statusResult.getLowestLevelDisplayCode();
String displayErrorText = statusResult.getLowestLevelDisplayText();
// Display the lowest level developer error string
String developerDebugText = statusResult.getLowestLevelExtraInfo();
// Display the complete debug log for this Error.
// This is what developers should use to fully debug issues.
String developerFullDebugLog = statusResult.toString();
}
}
}
Display Codes
The display codes that is returned in HyprStatusResult
are listed in the table below.
Display Error Text
The display error text that is returned in HyprStatusResult
are listed in the table below.
Android Errors
Refer to the Error Codes and Troubleshooting Tablefor more details. For Android-specific errors, see the Error Codes and Troubleshooting Table.
ADB Logging
ADB Logging can be enabled with an entry in the overrides.xml
file located in the following directory in the application project:
<project>/app/src/main/res/values/overrides.xml
Only Error Logging:
<string name="hypr_show_release_log_filter" translatable="false">1</string>
Only Performance Metric Summaries:
<string name="hypr_show_release_log_filter" translatable="false">131072</string>
Only FacetID:
<string name="hypr_show_release_log_filter" translatable="false">1048576</string>
To properly diagnose integration issues, it is recommended to set this filter when debugging issues. This will give the full HyprStatusResult
error trace logs.
All Release Logging:
<string name="hypr_show_release_log_filter" translatable="false">4294967295</string>
SDK for iOS
HYPR SDK for iOS has comprehensive error reporting throughout the framework. Errors generated at a particular layer will be bubbled up via a NSError-based "stack" of underlying errors in the NSError userInfo
dictionary. The root error may be easily accessed via the -rootError
category method on NSError, provided in HYPRError.h
.
Currently, the implementation of error handling abstracts a lot of the detail away from the top user and will return a localized description of Invalid Parameters, User Cancelled, or Failed to register user. All errors returned by HYPR SDK for iOS will be in the HYPRErrorDomain
, with specific codes described in HYPRError.h
. Underlying errors may be in whichever error domain is appropriate for the module generating them (NSURLErrorDomain
, Security Framework, etc.).
The userInfo
dictionary may contain additional keys, such as NSFailureReasonKey
, but this is not guaranteed for all errors. The mandatory keys for the userInfo
dictionary are:
-
NSLocalizedDescriptionKey
includes the general error cause; more detailed information could be found by looking at the error code -
HYPRErrorUserActionKey
includes the string with recommended user action, which can be used to present it to the app user
Additional keys include the following:
NSUnderlyingError
property of the returned error object will contain the root cause of the top-level error
Error codes returned from calls to the HYPR User Agent include the following:
HYPRErrorCancelled
HYPRErrorRegistrationFailed
HYPRErrorAuthenticationFailed
HYPRErrorDeregisterFailed
HYPRErrorRemoteDeviceSetupRegistrationFailed
HYPRErrorRemoteDeviceCompleteRegistrationFailed
HYPRErrorInvalidParameters
HYPRErrorRemoteDeviceAuthenticationFailed
HYPRErrorUserAgentNoProfileRegistered
HYPRErrorUserAgentDeviceCredentialsNotFound
HYPRErrorUserAgentDeviceAuthenticateWithShoveFailed
Refer to the Error Codes and Troubleshooting Tablefor more details.