From 4df8a6f38f2083b12b9a9566ccf05f7160e83f7e Mon Sep 17 00:00:00 2001 From: Ruby Rose Date: Sun, 23 Sep 2018 14:29:59 +0300 Subject: [PATCH 1/2] 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); } From e8cf8879f4dd8b87fdedd761d00525416c29fcc6 Mon Sep 17 00:00:00 2001 From: Ruby Rose Date: Sun, 23 Sep 2018 14:33:41 +0300 Subject: [PATCH 2/2] added changelog entry --- CHANGELOG.md | 1 + 1 file changed, 1 insertion(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 1d783712..a4a9b410 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -7,6 +7,7 @@ This is the rolling changelog for TShock for Terraria. Use past tense when addin * API: Added hooks for item, projectile and tile bans (@deadsurgeon42) * API: Changed `PlayerHooks` permission hook mechanisms to allow negation from hooks (@deadsurgeon42) * API: New WorldGrassSpread hook which shold allow corruption/crimson/hallow creep config options to work (@DeathCradle) +* Fixed a missing case in UserManager exception handling, which caused a rather cryptic console error instead of the intended error message (@deadsurgeon42) * Fixed saving when one player is one the server and another one joins (@MarioE) * Fixed /spawnmob not spawning negative IDs (@MarioE) * Validated tile placement on PlaceObject; clients can no longer place frames, paintings etc with dirt blocks (@bartico6, @ProfessorXZ)