Skip to content

Commit

Permalink
zendframework#6598 - using caught IntlException instances as previo…
Browse files Browse the repository at this point in the history
…us exceptions
  • Loading branch information
Ocramius committed Jan 3, 2015
1 parent 6704893 commit b2e9d8d
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 8 deletions.
6 changes: 3 additions & 3 deletions library/Zend/I18n/Validator/DateTime.php
Original file line number Diff line number Diff line change
Expand Up @@ -271,8 +271,8 @@ public function isValid($value)
if (intl_is_failure($formatter->getErrorCode())) {
throw new ValidatorException\InvalidArgumentException($formatter->getErrorMessage());
}
} catch (IntlException $e) {
throw new ValidatorException\InvalidArgumentException($e->getMessage());
} catch (IntlException $intlException) {
throw new ValidatorException\InvalidArgumentException($e->getMessage(), 0, $intlException);
}


Expand All @@ -283,7 +283,7 @@ public function isValid($value)
$this->error(self::INVALID_DATETIME);
return false;
}
} catch (IntlException $e) {
} catch (IntlException $intlException) {
$this->error(self::INVALID_DATETIME);
return false;
}
Expand Down
4 changes: 2 additions & 2 deletions library/Zend/I18n/Validator/Float.php
Original file line number Diff line number Diff line change
Expand Up @@ -127,8 +127,8 @@ public function isValid($value)
if (intl_is_failure($formatter->getErrorCode())) {
throw new Exception\InvalidArgumentException($formatter->getErrorMessage());
}
} catch (IntlException $e) {
throw new Exception\InvalidArgumentException($e->getMessage());
} catch (IntlException $intlException) {
throw new Exception\InvalidArgumentException($e->getMessage(), 0, $intlException);
}

if (StringUtils::hasPcreUnicodeSupport()) {
Expand Down
6 changes: 3 additions & 3 deletions library/Zend/I18n/Validator/Int.php
Original file line number Diff line number Diff line change
Expand Up @@ -114,8 +114,8 @@ public function isValid($value)
if (intl_is_failure($format->getErrorCode())) {
throw new Exception\InvalidArgumentException("Invalid locale string given");
}
} catch (IntlException $e) {
throw new Exception\InvalidArgumentException("Invalid locale string given");
} catch (IntlException $intlException) {
throw new Exception\InvalidArgumentException("Invalid locale string given", 0, $intlException);
}

try {
Expand All @@ -124,7 +124,7 @@ public function isValid($value)
$this->error(self::NOT_INT);
return false;
}
} catch (IntlException $e) {
} catch (IntlException $intlException) {
$this->error(self::NOT_INT);
return false;
}
Expand Down

0 comments on commit b2e9d8d

Please sign in to comment.