From: Thomas Kuschan Date: Mon, 19 Jun 2023 06:47:47 +0000 (+0200) Subject: Revert some changes to HttpFetchException X-Git-Tag: v23.06~1^2~16^2 X-Git-Url: http://source.bookstackapp.com/bookstack/commitdiff_plain/refs/pull/4317/head?ds=inline Revert some changes to HttpFetchException --- 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 -{ - /** - * 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()); - } - } +use Exception; - public function getStatusCode(): int - { - return 500; - } +class HttpFetchException extends Exception +{ } 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]); } }