cutter: Improve error message for unhandled cutting exceptions

In particular, use exception chaining instead of printing the old error.
pull/401/head
Mike Lang 3 months ago
parent 55f48e1881
commit 649a0fb2dd

@ -428,8 +428,8 @@ class Cutter(object):
yield chunk yield chunk
except Exception as ex: except Exception as ex:
self.logger.exception("Error occurred while trying to cut job {}".format(format_job(job))) self.logger.exception("Error occurred while trying to cut job {}".format(format_job(job)))
# Assumed error is not retryable # Assumed error is not retryable. Exception chaining preserves original error message.
raise UploadError("Error while cutting: {}".format(ex), retryable=False) raise UploadError("Unhandled exception while cutting", retryable=False) from ex
# The data is now fully uploaded, but the request is not finalized. # The data is now fully uploaded, but the request is not finalized.
# We now set the DB state to finalized so we know about failures during this # We now set the DB state to finalized so we know about failures during this

Loading…
Cancel
Save