Skip to content
Snippets Groups Projects
Commit f336f4ec authored by Markin Igor's avatar Markin Igor
Browse files

Parse error details for Android.

parent 454c4d5d
No related branches found
No related tags found
1 merge request!2Resolve "Rework auth flow."
...@@ -114,11 +114,17 @@ class _MainAppState extends State<MainApp> { ...@@ -114,11 +114,17 @@ class _MainAppState extends State<MainApp> {
log("Err $error"); log("Err $error");
String errorMessage = error.message; String errorMessage = error.message;
String errorDetails = error.details; String errorDetails = "";
try {
errorDetails = json.decode(error.details)["errorDescription"];
} catch (e) {
errorDetails = error.details;
}
if ( if (
// Handle cancellation for Android // Handle cancellation for Android
errorDetails == '{"type":0,"code":1,"errorDescription":"User cancelled flow"}' || errorDetails == 'User cancelled flow' ||
// Handle cancellation for iOS // Handle cancellation for iOS
errorMessage.toLowerCase().contains("the operation couldn") errorMessage.toLowerCase().contains("the operation couldn")
) { ) {
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment