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 object has a unique code which 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:
Error Code | Category | Platforms |
---|---|---|
8000 | GENERIC ERROR | Android & iOS |
8040 | NOT AUTHENTICATED USER | Android & iOS |
8041 | NOT AUTHENTICATED IMPLICIT | Android & iOS |
8042 | NOT FOUND USER PROFILE | Android & iOS |
8043 | NOT FOUND AUTHENTICATOR | Android & iOS |
8044 | NOT FOUND IDENTITY PROVIDER | Android & iOS |
8045 | NOT FOUND SECURITY CONTROLLER | Android |
8046 | HTTP REQUEST ERROR INTERNAL | Android & iOS |
8047 | HTTP REQUEST ERROR CODE | Android & iOS |
8048 | HTTP REQUEST NO RESPONSE | iOS |
8049 | NOT INITIALIZED ONEWELCOME SDK | Android |
8050 | INVALID URL | Android & iOS |
8051 | NOT IN PROGRESS CUSTOM REGISTRATION | Android & iOS |
8052 | NOT IN PROGRESS AUTHENTICATION | Android & iOS |
8053 | NOT IN PROGRESS OTP AUTHENTICATION | Android & iOS |
8054 | NOT IN PROGRESS PIN CREATION | Android & iOS |
8055 | NOT IN PROGRESS FINGERPRINT AUTHENTICATION | Android |
8056 | ALREADY IN PROGRESS MOBILE AUTHENTICATION | iOS |
8057 | ACTION NOT ALLOWED CUSTOM REGISTRATION CANCEL | Android & iOS |
8058 | ACTION NOT ALLOWED BROWSER REGISTRATION CANCEL | Android & iOS |
8059 | CONFIG ERROR | Android |
8060 | BIOMETRIC AUTHENTICATION NOT AVAILABLE | Android & iOS |
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, and the wrapper 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.
Handling Errors
You can catch PlatformExceptions and then match them based on the error code. The SDK supplies constants for all these possible error codes.
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