File tree Expand file tree Collapse file tree 1 file changed +10
-2
lines changed
core/src/main/java/com/web3auth/core Expand file tree Collapse file tree 1 file changed +10
-2
lines changed Original file line number Diff line number Diff line change @@ -170,7 +170,7 @@ class Web3Auth(web3AuthOptions: Web3AuthOptions, context: Context) {
170170 if (error == null ) {
171171 web3AuthResponse = resp
172172 } else {
173- print (error)
173+ initializeCf.completeExceptionally (error)
174174 }
175175 initializeCf.complete(null )
176176 }
@@ -333,7 +333,15 @@ class Web3Auth(web3AuthOptions: Web3AuthOptions, context: Context) {
333333 val sessionResponse: CompletableFuture <String > =
334334 sessionManager.authorizeSession(origin, context)
335335 sessionResponse.whenComplete { response, error ->
336- if (error == null ) {
336+ if (response.contains(" Error" )) {
337+ sessionCompletableFuture.completeExceptionally(
338+ Exception (
339+ Web3AuthError .getError(
340+ ErrorCode .NOUSERFOUND
341+ )
342+ )
343+ )
344+ } else if (error == null ) {
337345 val tempJson = JSONObject (response)
338346 web3AuthResponse = gson.fromJson(tempJson.toString(), Web3AuthResponse ::class .java)
339347 if (web3AuthResponse?.error?.isNotBlank() == true ) {
You can’t perform that action at this time.
0 commit comments