diff options
| author | Vainsocial root <root@vainsocial> | 2017-03-12 14:50:11 +0000 |
|---|---|---|
| committer | Vainsocial root <root@vainsocial> | 2017-03-12 14:50:11 +0000 |
| commit | b8d696eaed3510666014d57e114556ea7ef8ab42 (patch) | |
| tree | 9d87d0cbad4b67744ae4d5d9c97353980d166bf0 | |
| parent | 7098a1b835b6f7aca6c68cab60fe4858ea2abf1e (diff) | |
| download | shrinker-b8d696eaed3510666014d57e114556ea7ef8ab42.tar.gz shrinker-b8d696eaed3510666014d57e114556ea7ef8ab42.zip | |
catch and fail on SQL error
| -rw-r--r-- | api.py | 4 |
1 files changed, 4 insertions, 0 deletions
@@ -132,6 +132,10 @@ class Processor(joblib.worker.Worker): logging.error("%s: deadlocked!", jobid) raise joblib.worker.JobFailed("deadlock", True) # critical + except asyncpg.exceptions.IntegrityConstraintViolationError as err: + logging.error("%s: SQL error '%s'!", jobid, err) + raise joblib.worker.JobFailed({"id": object_id, + "error": str(err)}, True) logging.debug("record processed") if obj_id is not None: |
