From 4df8a6f38f2083b12b9a9566ccf05f7160e83f7e Mon Sep 17 00:00:00 2001 From: Ruby Rose Date: Sun, 23 Sep 2018 14:29:59 +0300 Subject: [PATCH] add another case to the exception message regex --- TShockAPI/DB/UserManager.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/TShockAPI/DB/UserManager.cs b/TShockAPI/DB/UserManager.cs index c819c40e..0c0dc5ff 100644 --- a/TShockAPI/DB/UserManager.cs +++ b/TShockAPI/DB/UserManager.cs @@ -76,7 +76,7 @@ namespace TShockAPI.DB catch (Exception ex) { // Detect duplicate user using a regexp as Sqlite doesn't have well structured exceptions - if (Regex.IsMatch(ex.Message, "Username.*not unique")) + if (Regex.IsMatch(ex.Message, "Username.*not unique|UNIQUE constraint failed: Users\\.Username")) throw new UserAccountExistsException(account.Name); throw new UserAccountManagerException("AddUser SQL returned an error (" + ex.Message + ")", ex); }