mirror of
https://github.com/sprockets/sprockets-postgres.git
synced 2024-12-27 11:17:30 +00:00
Explicitly raise a FK error
This commit is contained in:
parent
849cd5bb21
commit
16b12cf470
2 changed files with 6 additions and 1 deletions
2
VERSION
2
VERSION
|
@ -1 +1 @@
|
|||
1.6.1
|
||||
1.7.0
|
||||
|
|
|
@ -760,6 +760,11 @@ class RequestHandlerMixin:
|
|||
raise problemdetails.Problem(
|
||||
status_code=500, title='Query Timeout')
|
||||
raise web.HTTPError(500, reason='Query Timeout')
|
||||
elif isinstance(exc, errors.ForeignKeyViolation):
|
||||
if problemdetails:
|
||||
raise problemdetails.Problem(
|
||||
status_code=409, title='Foreign Key Violation')
|
||||
raise web.HTTPError(409, reason='Foreign Key Violation')
|
||||
elif isinstance(exc, errors.UniqueViolation):
|
||||
if problemdetails:
|
||||
raise problemdetails.Problem(
|
||||
|
|
Loading…
Reference in a new issue