Skip to content

Commit 6c39288

Browse files
committed
Clarify error messaging for transfers
1 parent a2548c1 commit 6c39288

File tree

5 files changed

+8
-5
lines changed

5 files changed

+8
-5
lines changed

app/Exceptions/Http/Server/ServerTransferringException.php

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,8 +7,11 @@
77

88
class ServerTransferringException extends HttpException
99
{
10+
/**
11+
* ServerTransferringException constructor.
12+
*/
1013
public function __construct()
1114
{
12-
parent::__construct(Response::HTTP_CONFLICT, 'Server is currently being transferred.');
15+
parent::__construct(Response::HTTP_CONFLICT, 'This server is currently being transferred to a new machine, please try again laster.');
1316
}
1417
}

app/Http/Controllers/Api/Remote/SftpAuthenticationController.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -113,7 +113,7 @@ public function __invoke(SftpAuthenticationFormRequest $request): JsonResponse
113113

114114
// Prevent SFTP access to servers that are being transferred.
115115
if (! is_null($server->transfer)) {
116-
throw new ServerTransferringException();
116+
throw new ServerTransferringException;
117117
}
118118

119119
// Remember, for security purposes, only reveal the existence of the server to people that

app/Http/Middleware/Api/Client/Server/AuthenticateServerAccess.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -82,7 +82,7 @@ public function handle(Request $request, Closure $next)
8282

8383
if (! is_null($server->transfer)) {
8484
if (! $user->root_admin || ($user->root_admin && ! $request->routeIs($this->except))) {
85-
throw new ServerTransferringException();
85+
throw new ServerTransferringException;
8686
}
8787
}
8888
}

app/Http/Middleware/Server/AccessingValidServer.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -83,7 +83,7 @@ public function handle(Request $request, Closure $next)
8383

8484
if (! is_null($server->transfer)) {
8585
if ($isApiRequest) {
86-
throw new ServerTransferringException();
86+
throw new ServerTransferringException;
8787
}
8888

8989
return $this->response->view('errors.transferring', [], 409);

app/Services/Servers/SuspensionService.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -60,7 +60,7 @@ public function toggle(Server $server, $action = self::ACTION_SUSPEND)
6060

6161
// Check if the server is currently being transferred.
6262
if (! is_null($server->transfer)) {
63-
throw new ServerTransferringException();
63+
throw new ServerTransferringException;
6464
}
6565

6666
$this->connection->transaction(function () use ($action, $server) {

0 commit comments

Comments
 (0)