diff --git a/app/Exceptions/HttpFetchException.php b/app/Exceptions/HttpFetchException.php index c445896c0..4ad45d92a 100644 --- a/app/Exceptions/HttpFetchException.php +++ b/app/Exceptions/HttpFetchException.php @@ -2,22 +2,8 @@ namespace BookStack\Exceptions; -class HttpFetchException extends PrettyException +use Exception; + +class HttpFetchException extends Exception { - /** - * Construct exception within BookStack\Uploads\HttpFetcher. - */ - public function __construct(string $message = '', int $code = 0, ?\Throwable $previous = null) - { - parent::__construct($message, $code, $previous); - - if ($previous) { - $this->setDetails($previous->getMessage()); - } - } - - public function getStatusCode(): int - { - return 500; - } } diff --git a/app/Uploads/UserAvatars.php b/app/Uploads/UserAvatars.php index 1cad3465c..3cd37812a 100644 --- a/app/Uploads/UserAvatars.php +++ b/app/Uploads/UserAvatars.php @@ -33,7 +33,7 @@ class UserAvatars $avatar = $this->saveAvatarImage($user); $user->avatar()->associate($avatar); $user->save(); - } catch (HttpFetchException $e) { + } catch (Exception $e) { Log::error('Failed to save user avatar image', ['exception' => $e]); } } @@ -48,7 +48,7 @@ class UserAvatars $avatar = $this->createAvatarImageFromData($user, $imageData, $extension); $user->avatar()->associate($avatar); $user->save(); - } catch (HttpFetchException $e) { + } catch (Exception $e) { Log::error('Failed to save user avatar image', ['exception' => $e]); } }