Improved api validation
This commit is contained in:
@@ -16,9 +16,9 @@ use CachetHQ\Cachet\Commands\Component\RemoveComponentCommand;
|
||||
use CachetHQ\Cachet\Commands\Component\UpdateComponentCommand;
|
||||
use CachetHQ\Cachet\Models\Component;
|
||||
use CachetHQ\Cachet\Models\Tag;
|
||||
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;
|
||||
@@ -75,7 +75,7 @@ class ComponentController extends AbstractApiController
|
||||
Binput::get('group_id'),
|
||||
(bool) Binput::get('enabled', true)
|
||||
));
|
||||
} catch (Exception $e) {
|
||||
} catch (QueryException $e) {
|
||||
throw new BadRequestHttpException();
|
||||
}
|
||||
|
||||
@@ -116,7 +116,7 @@ class ComponentController extends AbstractApiController
|
||||
Binput::get('group_id'),
|
||||
(bool) Binput::get('enabled', true)
|
||||
));
|
||||
} catch (Exception $e) {
|
||||
} catch (QueryException $e) {
|
||||
throw new BadRequestHttpException();
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user