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):
353
353
ma = match(u'^(.+)#md5=([0-9a-f]{32})$' , url )
354
354
if ma : # fragmented URL?
355
355
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 ))
357
359
url = ma .group (1 )
358
360
expected_md5 = ma .group (2 )
359
361
else :
@@ -374,7 +376,9 @@ def download(self):
374
376
if current_md5 != expected_md5 :
375
377
debug ('* Generated md5sum: {}' .format (current_md5 ))
376
378
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 ))
378
382
do_download = False
379
383
else :
380
384
do_download = False
@@ -393,7 +397,9 @@ def download(self):
393
397
if current_md5 != expected_md5 :
394
398
debug ('* Generated md5sum: {}' .format (current_md5 ))
395
399
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 ))
397
403
else :
398
404
info ('{} download already cached, skipping' .format (self .name ))
399
405
You can’t perform that action at this time.
0 commit comments