mirror of
https://github.com/MrUnknownDE/panel.git
synced 2026-04-17 05:43:45 +02:00
Fix allocation selection
This commit is contained in:
@@ -211,24 +211,24 @@ class AjaxController extends Controller
|
||||
}
|
||||
|
||||
try {
|
||||
|
||||
$repo = new Repositories\ServerRepository;
|
||||
$repo->changeBuild($server->id, [
|
||||
'default' => $request->input('connection'),
|
||||
]);
|
||||
return response('The default connection for this server has been updated. Please be aware that you will need to restart your server for this change to go into effect.');
|
||||
|
||||
} catch (\Exception $e) {
|
||||
if ($e instanceof \Pterodactyl\Exceptions\DisplayException || $e instanceof \Pterodactyl\Exceptions\DisplayValidationException) {
|
||||
return response()->json([
|
||||
'error' => $e->getMessage(),
|
||||
], 503);
|
||||
} else {
|
||||
Log::error($e);
|
||||
return response()->json([
|
||||
'error' => 'An unhandled exception occured while attemping to modify the default connection for this server.'
|
||||
], 503);
|
||||
}
|
||||
} catch (\Pterodactyl\Exceptions\DisplayValidationException $ex) {
|
||||
return response()->json([
|
||||
'error' => json_decode($ex->getMessage(), true),
|
||||
], 503);
|
||||
} catch (\Pterodactyl\Exceptions\DisplayException $ex) {
|
||||
return response()->json([
|
||||
'error' => $ex->getMessage(),
|
||||
], 503);
|
||||
} catch (\Exception $ex) {
|
||||
Log::error($ex);
|
||||
return response()->json([
|
||||
'error' => 'An unhandled exception occured while attemping to modify the default connection for this server.'
|
||||
], 503);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user