Skip to content

Commit 6b2d7b6

Browse files
committed
If folder does not exist, reload the file manager index
1 parent 8ce0863 commit 6b2d7b6

File tree

4 files changed

+28
-3
lines changed

4 files changed

+28
-3
lines changed

app/Exceptions/Http/Connection/DaemonConnectionException.php

Lines changed: 21 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,18 +7,38 @@
77

88
class DaemonConnectionException extends DisplayException
99
{
10+
/**
11+
* @var int
12+
*/
13+
private $statusCode = 500;
14+
1015
/**
1116
* Throw a displayable exception caused by a daemon connection error.
1217
*
1318
* @param \GuzzleHttp\Exception\GuzzleException $previous
19+
* @param bool $useStatusCode
1420
*/
15-
public function __construct(GuzzleException $previous)
21+
public function __construct(GuzzleException $previous, bool $useStatusCode = false)
1622
{
1723
/** @var \GuzzleHttp\Psr7\Response|null $response */
1824
$response = method_exists($previous, 'getResponse') ? $previous->getResponse() : null;
1925

26+
if ($useStatusCode) {
27+
$this->statusCode = is_null($response) ? 500 : $response->getStatusCode();
28+
}
29+
2030
parent::__construct(trans('admin/server.exceptions.daemon_exception', [
2131
'code' => is_null($response) ? 'E_CONN_REFUSED' : $response->getStatusCode(),
2232
]), $previous, DisplayException::LEVEL_WARNING);
2333
}
34+
35+
/**
36+
* Return the HTTP status code for this exception.
37+
*
38+
* @return int
39+
*/
40+
public function getStatusCode()
41+
{
42+
return $this->statusCode;
43+
}
2444
}

0 commit comments

Comments
 (0)