Skip to content

Commit

Permalink
fix: make two separate error log items a single item (#15179)
Browse files Browse the repository at this point in the history
  • Loading branch information
blankse committed May 16, 2023
1 parent c8f37b1 commit 44b9b31
Show file tree
Hide file tree
Showing 7 changed files with 7 additions and 14 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -1172,8 +1172,7 @@ public function wordExportAction(Request $request)
fclose($f);
}
} catch (\Exception $e) {
Logger::error('Word Export: ' . $e->getMessage());
Logger::error((string) $e);
Logger::error('Word Export: ' . $e);

throw $e;
}
Expand Down
3 changes: 1 addition & 2 deletions lib/Image/Adapter/Imagick.php
Original file line number Diff line number Diff line change
Expand Up @@ -155,8 +155,7 @@ public function load($imagePath, $options = [])
//}
}
} catch (\Exception $e) {
Logger::error('Unable to load image: ' . $imagePath);
Logger::error($e->getMessage());
Logger::error('Unable to load image ' . $imagePath . ': ' . $e);

return false;
}
Expand Down
3 changes: 1 addition & 2 deletions lib/Image/Chromium.php
Original file line number Diff line number Diff line change
Expand Up @@ -98,8 +98,7 @@ public static function convert(string $url, string $outputFile, string $windowSi
'clip' => $page->getFullPageClip(),
])->saveToFile($outputFile);
} catch (\Throwable $e) {
Logger::debug('Could not create image from url: ' . $url);
Logger::debug((string) $e);
Logger::debug('Could not create image from url ' . $url . ': ' . $e);

return false;
} finally {
Expand Down
3 changes: 1 addition & 2 deletions models/Asset/Document/ImageThumbnail.php
Original file line number Diff line number Diff line change
Expand Up @@ -102,8 +102,7 @@ public function generate($deferredAllowed = true)
}
}
} catch (\Exception $e) {
Logger::error("Couldn't create image-thumbnail of document " . $this->asset->getRealFullPath());
Logger::error($e->getMessage());
Logger::error("Couldn't create image-thumbnail of document " . $this->asset->getRealFullPath() . ': ' . $e);
}
}

Expand Down
3 changes: 1 addition & 2 deletions models/Asset/Image/Thumbnail.php
Original file line number Diff line number Diff line change
Expand Up @@ -142,8 +142,7 @@ public function generate($deferredAllowed = true)
$deferred = $deferredAllowed && $this->deferred;
$this->pathReference = Thumbnail\Processor::process($this->asset, $this->config, null, $deferred, $generated);
} catch (\Exception $e) {
Logger::error("Couldn't create thumbnail of image " . $this->asset->getRealFullPath());
Logger::error($e->getMessage());
Logger::error("Couldn't create thumbnail of image " . $this->asset->getRealFullPath() . ': ' . $e);
}
}
}
Expand Down
3 changes: 1 addition & 2 deletions models/Asset/Video.php
Original file line number Diff line number Diff line change
Expand Up @@ -124,8 +124,7 @@ public function getThumbnail($thumbnailName, $onlyFormats = [])
return $customSetting[$thumbnail->getName()];
}
} catch (\Exception $e) {
Logger::error("Couldn't create thumbnail of video " . $this->getRealFullPath());
Logger::error((string) $e);
Logger::error("Couldn't create thumbnail of video " . $this->getRealFullPath() . ': ' . $e);
}
}

Expand Down
3 changes: 1 addition & 2 deletions models/Asset/Video/ImageThumbnail.php
Original file line number Diff line number Diff line change
Expand Up @@ -162,8 +162,7 @@ public function generate($deferredAllowed = true)
$generated
);
} catch (\Exception $e) {
Logger::error("Couldn't create image-thumbnail of video " . $this->asset->getRealFullPath());
Logger::error($e->getMessage());
Logger::error("Couldn't create image-thumbnail of video " . $this->asset->getRealFullPath() . ': ' . $e);
}
}
}
Expand Down

0 comments on commit 44b9b31

Please sign in to comment.