forked from hans/Nominatim
introduce custom UsageError
This is a exception to be thrown when the error occures because of bad user data. We don't want to print a full stack trace in these cases but just tell the user what went wrong.
This commit is contained in:
@@ -27,7 +27,7 @@ class _Cursor(psycopg2.extras.DictCursor):
|
||||
self.execute(sql, args)
|
||||
|
||||
if self.rowcount != 1:
|
||||
raise ValueError("Query did not return a single row.")
|
||||
raise RuntimeError("Query did not return a single row.")
|
||||
|
||||
return self.fetchone()[0]
|
||||
|
||||
|
||||
Reference in New Issue
Block a user