cern-sis / issues-inspire

0 stars 0 forks source link

HAL push swallows exceptions #403

Closed michamos closed 3 months ago

michamos commented 8 months ago

While looking at HAL push failures for Mathieu, I noticed that some failed pushes get flagged as successes. I believe the culprit is https://github.com/inspirehep/inspirehep/blob/cbd3c39f54eee1b4ab584d2dd966d6f0dd4a228f/backend/inspirehep/hal/tasks.py#L106-L110: we catch the exception and handle duplicate ids in a special way, but we don't reraise the exception in case it's not a duplicate ID, so it's handled as a success and not a failure down the line.

MJedr commented 8 months ago

TECH Add else branch here https://github.com/inspirehep/inspirehep/blob/cbd3c39f54eee1b4ab584d2dd966d6f0dd4a228f/backend/inspirehep/hal/tasks.py#L110 and raise a custom exception (sth like HALCreateException) with the custom message payload