Merge branch 'general-devel' into player-data

This commit is contained in:
Lucas Nicodemus 2018-10-02 20:37:56 -07:00 committed by GitHub
commit 2a5e19da39
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
3 changed files with 5 additions and 3 deletions

View file

@ -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);
}