Skip to content

Commit

Permalink
Merge pull request #78 from Web3Auth/feat/errorcode-refactoring
Browse files Browse the repository at this point in the history
code refactored for User cancellation during login
  • Loading branch information
chaitanyapotti authored Jun 28, 2024
2 parents 0a5cdee + f5d47f9 commit 85b4086
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 85b4086

Please sign in to comment.