Skip to content

Commit

Permalink
FIX Don't log to error handler (#670)
Browse files Browse the repository at this point in the history
  • Loading branch information
GuySartorelli authored Jan 6, 2025
1 parent 1a4fffe commit c6bbd88
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion src/ImageManipulation.php
Original file line number Diff line number Diff line change
Expand Up @@ -725,7 +725,7 @@ public function Convert(string $toExtension): ?AssetContainer
return $converter->convert($this, $toExtension);
} catch (FileConverterException $e) {
/** @var LoggerInterface $logger */
$logger = Injector::inst()->get(LoggerInterface::class . '.errorhandler');
$logger = Injector::inst()->get(LoggerInterface::class);
$logger->error($e->getMessage());
return null;
}
Expand Down
2 changes: 1 addition & 1 deletion tests/php/ImageManipulationTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -595,7 +595,7 @@ public function testConvert(string $originalFileFixtureClass, string $originalFi
$mockLogger = $this->getMockBuilder(Logger::class)->setConstructorArgs(['testLogger'])->getMock();
$mockLogger->expects($success ? $this->never() : $this->once())
->method('error');
Injector::inst()->registerService($mockLogger, LoggerInterface::class . '.errorhandler');
Injector::inst()->registerService($mockLogger, LoggerInterface::class);

$result = $file->Convert($toExtension);

Expand Down

0 comments on commit c6bbd88

Please sign in to comment.