File tree Expand file tree Collapse file tree 1 file changed +9
-3
lines changed
Expand file tree Collapse file tree 1 file changed +9
-3
lines changed Original file line number Diff line number Diff line change @@ -353,7 +353,9 @@ def download(self):
353353 ma = match (u'^(.+)#md5=([0-9a-f]{32})$' , url )
354354 if ma : # fragmented URL?
355355 if self .md5sum :
356- raise Exception ('Recipe md5sum via fragmented URL only!' )
356+ raise ValueError (
357+ ('Received md5sum from both the {} recipe '
358+ 'and its url' ).format (self .name ))
357359 url = ma .group (1 )
358360 expected_md5 = ma .group (2 )
359361 else :
@@ -374,7 +376,9 @@ def download(self):
374376 if current_md5 != expected_md5 :
375377 debug ('* Generated md5sum: {}' .format (current_md5 ))
376378 debug ('* Expected md5sum: {}' .format (expected_md5 ))
377- raise Exception ('Cached unexpected content!' )
379+ raise ValueError (
380+ ('Generated md5sum does not match expected md5sum '
381+ 'for {} recipe' ).format (self .name ))
378382 do_download = False
379383 else :
380384 do_download = False
@@ -393,7 +397,9 @@ def download(self):
393397 if current_md5 != expected_md5 :
394398 debug ('* Generated md5sum: {}' .format (current_md5 ))
395399 debug ('* Expected md5sum: {}' .format (expected_md5 ))
396- raise Exception ('Downloaded unexpected content!' )
400+ raise ValueError (
401+ ('Generated md5sum does not match expected md5sum '
402+ 'for {} recipe' ).format (self .name ))
397403 else :
398404 info ('{} download already cached, skipping' .format (self .name ))
399405
You can’t perform that action at this time.
0 commit comments