mirror of
https://github.com/BookStackApp/BookStack.git
synced 2026-02-25 19:07:25 +03:00
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.
This commit is contained in:
@@ -2,8 +2,22 @@
|
||||
|
||||
namespace BookStack\Exceptions;
|
||||
|
||||
use Exception;
|
||||
|
||||
class HttpFetchException extends Exception
|
||||
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;
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user