diff --git a/VERSION b/VERSION index 9c6d629..bd8bf88 100644 --- a/VERSION +++ b/VERSION @@ -1 +1 @@ -1.6.1 +1.7.0 diff --git a/sprockets_postgres.py b/sprockets_postgres.py index cd8995b..783ba73 100644 --- a/sprockets_postgres.py +++ b/sprockets_postgres.py @@ -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(