Refactor handleError function to handle ModelNotFoundException
This commit is contained in:
@@ -142,6 +142,10 @@ function handleError(?Throwable $error = null, ?Livewire\Component $livewire = n
|
|||||||
return 'Duplicate entry found. Please use a different name.';
|
return 'Duplicate entry found. Please use a different name.';
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if ($error instanceof \Illuminate\Database\Eloquent\ModelNotFoundException) {
|
||||||
|
abort(404);
|
||||||
|
}
|
||||||
|
|
||||||
if ($error instanceof Throwable) {
|
if ($error instanceof Throwable) {
|
||||||
$message = $error->getMessage();
|
$message = $error->getMessage();
|
||||||
} else {
|
} else {
|
||||||
@@ -3983,13 +3987,14 @@ function instanceSettings()
|
|||||||
return InstanceSettings::get();
|
return InstanceSettings::get();
|
||||||
}
|
}
|
||||||
|
|
||||||
function loadConfigFromGit(string $repository, string $branch, string $base_directory, int $server_id, int $team_id) {
|
function loadConfigFromGit(string $repository, string $branch, string $base_directory, int $server_id, int $team_id)
|
||||||
|
{
|
||||||
|
|
||||||
$server = Server::find($server_id)->where('team_id', $team_id)->first();
|
$server = Server::find($server_id)->where('team_id', $team_id)->first();
|
||||||
if (! $server) {
|
if (! $server) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
$uuid = new Cuid2();
|
$uuid = new Cuid2;
|
||||||
$cloneCommand = "git clone --no-checkout -b $branch $repository .";
|
$cloneCommand = "git clone --no-checkout -b $branch $repository .";
|
||||||
$workdir = rtrim($base_directory, '/');
|
$workdir = rtrim($base_directory, '/');
|
||||||
$fileList = collect([".$workdir/coolify.json"]);
|
$fileList = collect([".$workdir/coolify.json"]);
|
||||||
|
|||||||
Reference in New Issue
Block a user