mirror of
https://git.anonymousland.org/anonymousland/synapse-product.git
synced 2024-09-07 17:52:03 +00:00
add more detail to logging regarding "More than one row matched" error (#4234)
This commit is contained in:
parent
ecc23188f4
commit
b5ac0ffa0a
1
changelog.d/4234.misc
Normal file
1
changelog.d/4234.misc
Normal file
@ -0,0 +1 @@
|
||||
add more detail to logging regarding "More than one row matched" error
|
@ -850,9 +850,9 @@ class SQLBaseStore(object):
|
||||
rowcount = cls._simple_update_txn(txn, table, keyvalues, updatevalues)
|
||||
|
||||
if rowcount == 0:
|
||||
raise StoreError(404, "No row found")
|
||||
raise StoreError(404, "No row found (%s)" % (table,))
|
||||
if rowcount > 1:
|
||||
raise StoreError(500, "More than one row matched")
|
||||
raise StoreError(500, "More than one row matched (%s)" % (table,))
|
||||
|
||||
@staticmethod
|
||||
def _simple_select_one_txn(txn, table, keyvalues, retcols,
|
||||
@ -869,9 +869,9 @@ class SQLBaseStore(object):
|
||||
if not row:
|
||||
if allow_none:
|
||||
return None
|
||||
raise StoreError(404, "No row found")
|
||||
raise StoreError(404, "No row found (%s)" % (table,))
|
||||
if txn.rowcount > 1:
|
||||
raise StoreError(500, "More than one row matched")
|
||||
raise StoreError(500, "More than one row matched (%s)" % (table,))
|
||||
|
||||
return dict(zip(retcols, row))
|
||||
|
||||
@ -903,9 +903,9 @@ class SQLBaseStore(object):
|
||||
|
||||
txn.execute(sql, list(keyvalues.values()))
|
||||
if txn.rowcount == 0:
|
||||
raise StoreError(404, "No row found")
|
||||
raise StoreError(404, "No row found (%s)" % (table,))
|
||||
if txn.rowcount > 1:
|
||||
raise StoreError(500, "more than one row matched")
|
||||
raise StoreError(500, "More than one row matched (%s)" % (table,))
|
||||
|
||||
def _simple_delete(self, table, keyvalues, desc):
|
||||
return self.runInteraction(
|
||||
|
Loading…
Reference in New Issue
Block a user