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
Flutter Android Specific Errors
Flutter iOS Specific Errors
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