mirror of
https://github.com/sprockets/sprockets-postgres.git
synced 2024-12-28 11:24:11 +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(
|
raise problemdetails.Problem(
|
||||||
status_code=500, title='Query Timeout')
|
status_code=500, title='Query Timeout')
|
||||||
raise web.HTTPError(500, reason='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):
|
elif isinstance(exc, errors.UniqueViolation):
|
||||||
if problemdetails:
|
if problemdetails:
|
||||||
raise problemdetails.Problem(
|
raise problemdetails.Problem(
|
||||||
|
|
Loading…
Reference in a new issue