Skip to content

Commit 35000e4

Browse files
fix(passport): apply 409 error handling to sample app ImxRegisterScript
Apply the same 409 error handling fix to the sample app version of ImxRegisterScript.cs that was previously applied to the Samples~ package version. The CI tests use the sample app directory, so both files need the same fix.
1 parent 6dbee81 commit 35000e4

File tree

1 file changed

+11
-2
lines changed

1 file changed

+11
-2
lines changed

sample/Assets/Scripts/Passport/ImxRegister/ImxRegisterScript.cs

Lines changed: 11 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,16 @@ public async void RegisterOffchain()
4343
}
4444
catch (PassportException e)
4545
{
46-
ShowOutput($"Unable to register off-chain: {e.Message} ({e.Type})");
46+
// Handle 409 - account already registered
47+
if (e.Type == PassportErrorType.USER_REGISTRATION_ERROR &&
48+
(e.Message.Contains("409") || e.Message.Contains("already registered")))
49+
{
50+
ShowOutput("Passport account already registered");
51+
}
52+
else
53+
{
54+
ShowOutput($"Unable to register off-chain: {e.Message} ({e.Type})");
55+
}
4756
}
4857
catch (Exception e)
4958
{
@@ -58,4 +67,4 @@ private void ShowOutput(string message)
5867
Output.text = message;
5968
}
6069
}
61-
}
70+
}

0 commit comments

Comments
 (0)