Commit 7ad5be2d authored by Mike Kozono's avatar Mike Kozono

Refactor: Raise instead of return nil

If not checksummable.

No behavior change, because exceptions are caught and tracked as
failures. This is more explicit than the current logic where the
transition to `verification_succeeded` raises an error due to the `nil`
checksum.
parent 33c8dfbd
......@@ -52,7 +52,7 @@ module Gitlab
#
# @return [String] SHA256 hash of the carrierwave file
def calculate_checksum
return unless checksummable?
raise 'File is not checksummable' unless checksummable?
self.class.hexdigest(replicator.carrierwave_uploader.path)
end
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment