]> BookStack Code Mirror - bookstack/commitdiff
Revert some changes to HttpFetchException 4317/head
authorThomas Kuschan <redacted>
Mon, 19 Jun 2023 06:47:47 +0000 (08:47 +0200)
committerThomas Kuschan <redacted>
Mon, 19 Jun 2023 06:47:47 +0000 (08:47 +0200)
app/Exceptions/HttpFetchException.php
app/Uploads/UserAvatars.php

index c445896c01e13f87b1ad9cd7a7826bccbee6a0ff..4ad45d92a35a8449f35e8c8f8ee8db44ce17f4df 100644 (file)
@@ -2,22 +2,8 @@
 
 namespace BookStack\Exceptions;
 
 
 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
+{
 }
 }
index 1cad3465c785ac5d2c871c542e384dcd48f9d237..3cd37812acbd40f14aec23ae2bb1d386a49df693 100644 (file)
@@ -33,7 +33,7 @@ class UserAvatars
             $avatar = $this->saveAvatarImage($user);
             $user->avatar()->associate($avatar);
             $user->save();
             $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]);
         }
     }
             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();
             $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]);
         }
     }
             Log::error('Failed to save user avatar image', ['exception' => $e]);
         }
     }