mirror of
https://github.com/vitodeploy/vito.git
synced 2025-07-01 22:16:15 +00:00
#591 - sites
This commit is contained in:
@ -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.',
|
||||
]);
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user