Skip to content

Commit caae270

Browse files
committed
WIP: avoid logging user error as exception
1 parent 99bef70 commit caae270

File tree

1 file changed

+9
-1
lines changed

1 file changed

+9
-1
lines changed

invenio_rdm_records/services/vcs/release.py

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -283,9 +283,17 @@ def process_release(self):
283283
record = self.publish()
284284
return record
285285
except Exception as ex:
286-
current_app.logger.exception(
286+
message = (
287287
f"Error while processing VCS release {self.db_release.id}: {str(ex)}"
288288
)
289+
290+
# A CustomVCSReleaseNoRetryError implies that the release failed due to a user error. Therefore, we should not
291+
# log this as an exception. This error will be caught upstream by InvenioVCS.
292+
if isinstance(ex, CustomVCSReleaseNoRetryError):
293+
current_app.logger.info(message)
294+
else:
295+
current_app.logger.exception(message)
296+
289297
raise ex
290298

291299
def serialize_record(self):

0 commit comments

Comments
 (0)