diff --git a/iiif_validator/tests/region_pixels.py b/iiif_validator/tests/region_pixels.py index db4e1e8..207b630 100644 --- a/iiif_validator/tests/region_pixels.py +++ b/iiif_validator/tests/region_pixels.py @@ -31,6 +31,6 @@ def run(self, result): return result else: raise ValidatorError('color', 1,0, result) - except: + except Exception as error: self.validationInfo.check('status', result.last_status, 200, result) - raise + raise ValidatorError('General error', str(error), 'No error', result,'Failed to check size due to: {}'.format(error)) diff --git a/iiif_validator/tests/size_ch.py b/iiif_validator/tests/size_ch.py index 5dfdb93..1524485 100644 --- a/iiif_validator/tests/size_ch.py +++ b/iiif_validator/tests/size_ch.py @@ -35,6 +35,6 @@ def run(self, result): return result else: raise ValidatorError('color', 1,0, result) - except: + except Exception as error: self.validationInfo.check('status', result.last_status, 200, result) - raise + raise ValidatorError('General error', str(error), 'No error', result,'Failed to check size due to: {}'.format(error)) diff --git a/iiif_validator/tests/size_percent.py b/iiif_validator/tests/size_percent.py index 7dac6fb..c415dcc 100644 --- a/iiif_validator/tests/size_percent.py +++ b/iiif_validator/tests/size_percent.py @@ -35,6 +35,7 @@ def run(self, result): else: raise ValidatorError('color', 1,0, result) - except: + except Exception as error: self.validationInfo.check('status', result.last_status, 200, result) - raise + + raise ValidatorError('General error', str(error), 'No error', result,'Failed to check size due to: {}'.format(error)) diff --git a/iiif_validator/tests/size_region.py b/iiif_validator/tests/size_region.py index e88dfff..ab2d6d3 100644 --- a/iiif_validator/tests/size_region.py +++ b/iiif_validator/tests/size_region.py @@ -29,6 +29,5 @@ def run(self, result): if not ok: raise ValidatorError('color', 1, self.validationInfo.colorInfo[0][0], result) return result - except: - self.validationInfo.check('status', result.last_status, 200, result) - raise + except Exception as error: + raise ValidatorError('General error', str(error), 'No error', result,'Failed to check size due to: {}'.format(error)) diff --git a/iiif_validator/tests/size_wc.py b/iiif_validator/tests/size_wc.py index f2744d9..8b215a8 100644 --- a/iiif_validator/tests/size_wc.py +++ b/iiif_validator/tests/size_wc.py @@ -13,6 +13,7 @@ def run(self, result): s = random.randint(450,750) params = {'size': '%s,' % s} img = result.get_image(params) + self.validationInfo.check('status', result.last_status, 200, result) self.validationInfo.check('size', img.size, (s,s), result) # Find square size @@ -34,6 +35,5 @@ def run(self, result): return result else: raise ValidatorError('color', 1,0, result) - except: - self.validationInfo.check('status', result.last_status, 200, result) - raise + except Exception as error: + raise ValidatorError('General error', str(error), 'No error', result,'Failed to check size due to: {}'.format(error))