Error handling
Introduction
This topic guide describes how errors should be handled that are generated by the OneWelcome Flutter plugin. We will start by enumerating the plugin specific errors.
Error codes
Every error has a code which uniquely identifies the error. Some of our plugin errors occur on both the iOS and Android implementation, while others can only occur on a specific platform. The errors specific to OneWelcome Flutter plugin are as follows:
Wrapper Errors
8000 - genericError
8001 - userProfileDoesNotExist
8002 - noUserProfileIsAuthenticated
8004 -authenticatorNotFound
8011 - httpRequestError
8013 - errorCodeHttpRequest
8019 - wrapperTypeError
8035 - userNotAuthenticatedImplicitly
8036 - methodArgumentNotFound
8037 - argumentNotCorrect
Flutter Android Specific Errors
8005 - identityProviderNotFound
8006 - qrCodeHasNoData
8007 - methodToCallNotFound
8008 - urlCantBeNull
8009 - malformedUrl
8010 - preferredAuthenticatorError
8012 - oneWelcomeSdkNotInitialized
8032 - configError
8033 - securityControllerNotFound
8034 - registrationNotInProgress
Flutter iOS Specific Errors
8014 - providedUrlIncorrect
8015 - loginCanceled
8016 - enrollmentFailed
8017 - authenticationCancelled
8018 - changingPinCancelled
8020 - registrationCancelled
8021 - cantHandleOTP
8022 - incorrectResourcesAccess
8023 - authenticatorNotRegistered
8024 - authenticatorDeregistrationCancelled
8025 - failedParseData
8026 - responseIsNull
8027 - authenticatorIdIsNull
8028 - emptyInputValue
8029 - unsupportedPinAction
8030 - unsupportedCustomRegistrationAction
8031 - authenticatorRegistrationCancelled
Plugin error codes
As the OneWelcome Flutter plugin is a wrapper for the OneWelcome Android and iOS SDKs, many errors that are returned come directly from the SDKs themselves. This is true for error codes in the ranges 9000 and higher.
These error codes are mostly consistent. However, there may be some small differences between the two platforms. See the error handling documentation for the Android SDK and the iOS SDK for details. Both sets of documentation also include a helpful error map at the bottom of the page.
Platform Exception
As mentioned previously, many of the errors that are thrown will be errors that originate from our native SDKs because we are dealing with a wrapper plugin. These errors will be presented in the form of PlatformExceptions. We want to emphasise, that the property values of this object can be slightly different due to differences in the native SDKs.
Details Property
The details property of the returned platform exception will contain an overview and sometimes additional data regarding the error. This data is represented using a LinkedHashMap. The structure of this map is displayed below
{
title: "Error", __ String
message: "the message passed by the plugin; platformexception.message", __String
code: "the error code passed by the plugin: platformexception.code", __ String
__ Optional Response LinkedHashMap in case a resource call
response: {
url: "https:__..", __ String
statusCode: 404, __ Integer
headers: {}, __ LinkedHashMap
body: "json string of the requested body" __ String
}
__ Optional iOS native properties to give additional information for resource calls
iosCode: 10000 __ Integer
iosMessage: "" __ String
}