mirror of
https://github.com/BookStackApp/BookStack.git
synced 2025-05-03 07:49:57 +00:00
Revert some changes to HttpFetchException
This commit is contained in:
parent
c35080d6ce
commit
97d46f43a7
2 changed files with 5 additions and 19 deletions
app
|
@ -2,22 +2,8 @@
|
||||||
|
|
||||||
namespace BookStack\Exceptions;
|
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;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -33,7 +33,7 @@ class UserAvatars
|
||||||
$avatar = $this->saveAvatarImage($user);
|
$avatar = $this->saveAvatarImage($user);
|
||||||
$user->avatar()->associate($avatar);
|
$user->avatar()->associate($avatar);
|
||||||
$user->save();
|
$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);
|
$avatar = $this->createAvatarImageFromData($user, $imageData, $extension);
|
||||||
$user->avatar()->associate($avatar);
|
$user->avatar()->associate($avatar);
|
||||||
$user->save();
|
$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]);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue