mirror of
https://git.anonymousland.org/anonymousland/synapse.git
synced 2025-12-15 08:41:24 -05:00
Use generic db exceptions rather than sqlite3 specific ones
This commit is contained in:
parent
a43b40449b
commit
279a547a8b
2 changed files with 2 additions and 6 deletions
|
|
@ -15,8 +15,6 @@
|
|||
|
||||
from twisted.internet import defer
|
||||
|
||||
from sqlite3 import IntegrityError
|
||||
|
||||
from synapse.api.errors import StoreError, Codes
|
||||
|
||||
from ._base import SQLBaseStore, cached
|
||||
|
|
@ -76,7 +74,7 @@ class RegistrationStore(SQLBaseStore):
|
|||
txn.execute("INSERT INTO users(name, password_hash, creation_ts) "
|
||||
"VALUES (?,?,?)",
|
||||
[user_id, password_hash, now])
|
||||
except IntegrityError:
|
||||
except self.database_engine.module.IntegrityError:
|
||||
raise StoreError(
|
||||
400, "User ID already taken.", errcode=Codes.USER_IN_USE
|
||||
)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue