@@ -154,7 +154,7 @@ class Web3Auth(web3AuthOptions: Web3AuthOptions) {
154154 if (web3AuthResponse.error?.isNotBlank() == true ) {
155155 loginCompletableFuture.completeExceptionally(
156156 UnKnownException (
157- web3AuthResponse.error ? : " Something went wrong "
157+ web3AuthResponse.error ? : Web3AuthError .getError( ErrorCode . SOMETHING_WENT_ERROR )
158158 )
159159 )
160160 }
@@ -259,7 +259,9 @@ class Web3Auth(web3AuthOptions: Web3AuthOptions) {
259259 Handler (Looper .getMainLooper()).postDelayed(10 ) {
260260 sessionCompletableFuture.completeExceptionally(
261261 UnKnownException (
262- web3AuthResponse.error ? : " Something went wrong"
262+ web3AuthResponse.error ? : Web3AuthError .getError(
263+ ErrorCode .SOMETHING_WENT_ERROR
264+ )
263265 )
264266 )
265267 }
@@ -334,7 +336,7 @@ class Web3Auth(web3AuthOptions: Web3AuthOptions) {
334336
335337 fun getPrivkey (): String {
336338 val privKey: String = if (web3AuthResponse == null ) {
337- throw Error (" No user found, please login again " )
339+ throw Error (Web3AuthError .getError( ErrorCode . NOUSERFOUND ) )
338340 } else {
339341 if (web3AuthOption.useCoreKitKey == true ) {
340342 web3AuthResponse.coreKitEd25519PrivKey.toString()
@@ -347,7 +349,7 @@ class Web3Auth(web3AuthOptions: Web3AuthOptions) {
347349
348350 fun getEd25519PrivKey (): String {
349351 val ed25519Key: String = if (web3AuthResponse == null ) {
350- throw Error (" No user found, please login again " )
352+ throw Error (Web3AuthError .getError( ErrorCode . NOUSERFOUND ) )
351353 } else {
352354 if (web3AuthOption.useCoreKitKey == true ) {
353355 web3AuthResponse.coreKitEd25519PrivKey.toString()
@@ -360,7 +362,7 @@ class Web3Auth(web3AuthOptions: Web3AuthOptions) {
360362
361363 fun getUserInfo (): UserInfo ? {
362364 if (web3AuthResponse == null || web3AuthResponse.userInfo == null ) {
363- throw Error (" No userInfo found, please login again " )
365+ throw Error (Web3AuthError .getError( ErrorCode . NOUSERFOUND ) )
364366 } else {
365367 return web3AuthResponse.userInfo
366368 }
0 commit comments