Skip to content

Commit

Permalink
Merge pull request #157 from CyberSecutor/master
Browse files Browse the repository at this point in the history
Catch the correct exception when using properties of a specific exception
  • Loading branch information
jissereitsma authored Sep 27, 2023
2 parents af52815 + 5e9d6bf commit fc479d3
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 3 deletions.
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,10 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0

## [Unreleased]

## [0.13.4] - 26 September 2023
### Fixed
- Catch the correct exception when using properties of a specific exception.

## [0.13.3] - 22 September 2023
### Fixed
- Properly check for MIME-typed (fix of #149)
Expand Down
9 changes: 6 additions & 3 deletions Convertor/ConvertWrapper.php
Original file line number Diff line number Diff line change
Expand Up @@ -48,15 +48,18 @@ public function __construct(
public function convert(string $sourceImageFilename, string $destinationImageFilename): void
{
$options = $this->getOptions();
foreach ($this->config->getConvertors() as $convertor) {
foreach ($this->config->getConvertors() as $convertor){

Check warning on line 51 in Convertor/ConvertWrapper.php

View workflow job for this annotation

GitHub Actions / Static Code Analysis

Expected "foreach (...) {\n"; found "foreach (...){\n"

Check warning on line 51 in Convertor/ConvertWrapper.php

View workflow job for this annotation

GitHub Actions / Static Code Analysis

Expected 1 space(s) after closing parenthesis; found 0
$options['converter'] = $convertor;
try {
WebPConvert::convert($sourceImageFilename, $destinationImageFilename, $options);
break;
} catch (Exception $e) {
} catch (ConversionFailedException $e) {
$this->logger->debug($e->getMessage() . ' - ' . $e->description, $e->getTrace());
continue;
} catch (\Exception $e) {
$this->logger->debug($e->getMessage(), $e->getTrace());
continue;
}
break;
}
}

Expand Down

0 comments on commit fc479d3

Please sign in to comment.