Skip to content

Commit

Permalink
code refactored for User cancellation during login
Browse files Browse the repository at this point in the history
Signed-off-by: Gaurav Goel <[email protected]>
  • Loading branch information
grvgoel81 authored and Gaurav Goel committed Jun 28, 2024
1 parent 0a5cdee commit f5d47f9
Showing 1 changed file with 6 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,11 @@ class Web3AuthFlutterPlugin : FlutterPlugin, ActivityAware, MethodCallHandler,
launch(Dispatchers.Main) { result.notImplemented() }
} catch (e: Throwable) {
launch(Dispatchers.Main) {
result.error("error", e.message, e.localizedMessage)
if(e.message == "User Cancelled") {
result.error("UserCancelledException", e.message, e.localizedMessage)
} else {
result.error("error", e.message, e.localizedMessage)
}
}
}
}
Expand Down Expand Up @@ -118,7 +122,7 @@ class Web3AuthFlutterPlugin : FlutterPlugin, ActivityAware, MethodCallHandler,
} catch (e: NotImplementedError) {
throw Error(e)
} catch (e: Throwable) {
throw Error(e)
throw Error("User Cancelled")
}
}

Expand Down

0 comments on commit f5d47f9

Please sign in to comment.