This commit is contained in:
Saeed Vaziry
2025-06-04 08:08:20 +02:00
parent efacadba10
commit c3f69f3247
114 changed files with 4032 additions and 765 deletions

View File

@ -3,5 +3,20 @@
namespace App\Exceptions;
use Exception;
use Illuminate\Http\RedirectResponse;
use Illuminate\Http\Request;
use Illuminate\Validation\ValidationException;
class DeploymentScriptIsEmptyException extends Exception {}
class DeploymentScriptIsEmptyException extends Exception
{
public function render(Request $request): RedirectResponse
{
if ($request->header('X-Inertia')) {
return back()->with('error', 'Cannot deploy an empty deployment script.');
}
throw ValidationException::withMessages([
'deployment_script' => 'Deployment script cannot be empty.',
]);
}
}