1
0
mirror of https://github.com/BookStackApp/BookStack.git synced 2025-08-18 05:42:03 +03:00
Files
bookstack/app/Exceptions/HttpFetchException.php
Thomas Kuschan c35080d6ce Modify HttpFetchException handle to log exception
Within the flow of HttpFetchException, the actual exception from curl is preserved and logged. Make HttpFetchException a pretty exception for when it is shown to users.
2023-06-16 09:21:25 +02:00

24 lines
508 B
PHP

<?php
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());
}
}
public function getStatusCode(): int
{
return 500;
}
}