mirror of
https://git.anonymousland.org/anonymousland/synapse-product.git
synced 2024-10-01 08:25:44 -04: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)
|
rowcount = cls._simple_update_txn(txn, table, keyvalues, updatevalues)
|
||||||
|
|
||||||
if rowcount == 0:
|
if rowcount == 0:
|
||||||
raise StoreError(404, "No row found")
|
raise StoreError(404, "No row found (%s)" % (table,))
|
||||||
if rowcount > 1:
|
if rowcount > 1:
|
||||||
raise StoreError(500, "More than one row matched")
|
raise StoreError(500, "More than one row matched (%s)" % (table,))
|
||||||
|
|
||||||
@staticmethod
|
@staticmethod
|
||||||
def _simple_select_one_txn(txn, table, keyvalues, retcols,
|
def _simple_select_one_txn(txn, table, keyvalues, retcols,
|
||||||
@ -869,9 +869,9 @@ class SQLBaseStore(object):
|
|||||||
if not row:
|
if not row:
|
||||||
if allow_none:
|
if allow_none:
|
||||||
return None
|
return None
|
||||||
raise StoreError(404, "No row found")
|
raise StoreError(404, "No row found (%s)" % (table,))
|
||||||
if txn.rowcount > 1:
|
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))
|
return dict(zip(retcols, row))
|
||||||
|
|
||||||
@ -903,9 +903,9 @@ class SQLBaseStore(object):
|
|||||||
|
|
||||||
txn.execute(sql, list(keyvalues.values()))
|
txn.execute(sql, list(keyvalues.values()))
|
||||||
if txn.rowcount == 0:
|
if txn.rowcount == 0:
|
||||||
raise StoreError(404, "No row found")
|
raise StoreError(404, "No row found (%s)" % (table,))
|
||||||
if txn.rowcount > 1:
|
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):
|
def _simple_delete(self, table, keyvalues, desc):
|
||||||
return self.runInteraction(
|
return self.runInteraction(
|
||||||
|
Loading…
Reference in New Issue
Block a user