From 97d46f43a76db9daed2692e73af613fad6e0363d Mon Sep 17 00:00:00 2001
From: Thomas Kuschan <mail@thomaskuschan.de>
Date: Mon, 19 Jun 2023 08:47:47 +0200
Subject: [PATCH] Revert some changes to HttpFetchException

---
 app/Exceptions/HttpFetchException.php | 20 +++-----------------
 app/Uploads/UserAvatars.php           |  4 ++--
 2 files changed, 5 insertions(+), 19 deletions(-)

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]);
         }
     }