Improved api validation
This commit is contained in:
@@ -15,9 +15,9 @@ use CachetHQ\Cachet\Commands\Incident\RemoveIncidentCommand;
|
||||
use CachetHQ\Cachet\Commands\Incident\ReportIncidentCommand;
|
||||
use CachetHQ\Cachet\Commands\Incident\UpdateIncidentCommand;
|
||||
use CachetHQ\Cachet\Models\Incident;
|
||||
use Exception;
|
||||
use GrahamCampbell\Binput\Facades\Binput;
|
||||
use Illuminate\Contracts\Auth\Guard;
|
||||
use Illuminate\Database\QueryException;
|
||||
use Illuminate\Foundation\Bus\DispatchesJobs;
|
||||
use Illuminate\Http\Request;
|
||||
use Symfony\Component\HttpKernel\Exception\BadRequestHttpException;
|
||||
@@ -77,7 +77,7 @@ class IncidentController extends AbstractApiController
|
||||
Binput::get('template'),
|
||||
Binput::get('vars')
|
||||
));
|
||||
} catch (Exception $e) {
|
||||
} catch (QueryException $e) {
|
||||
throw new BadRequestHttpException();
|
||||
}
|
||||
|
||||
@@ -107,7 +107,7 @@ class IncidentController extends AbstractApiController
|
||||
Binput::get('template'),
|
||||
Binput::get('vars')
|
||||
));
|
||||
} catch (Exception $e) {
|
||||
} catch (QueryException $e) {
|
||||
throw new BadRequestHttpException();
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user