add another case to the exception message regex
This commit is contained in:
parent
e08ba6b362
commit
4df8a6f38f
1 changed files with 1 additions and 1 deletions
|
|
@ -76,7 +76,7 @@ namespace TShockAPI.DB
|
||||||
catch (Exception ex)
|
catch (Exception ex)
|
||||||
{
|
{
|
||||||
// Detect duplicate user using a regexp as Sqlite doesn't have well structured exceptions
|
// 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 UserAccountExistsException(account.Name);
|
||||||
throw new UserAccountManagerException("AddUser SQL returned an error (" + ex.Message + ")", ex);
|
throw new UserAccountManagerException("AddUser SQL returned an error (" + ex.Message + ")", ex);
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue