Improved api validation
This commit is contained in:
@@ -15,8 +15,8 @@ use CachetHQ\Cachet\Commands\ComponentGroup\AddComponentGroupCommand;
|
||||
use CachetHQ\Cachet\Commands\ComponentGroup\RemoveComponentGroupCommand;
|
||||
use CachetHQ\Cachet\Commands\ComponentGroup\UpdateComponentGroupCommand;
|
||||
use CachetHQ\Cachet\Models\ComponentGroup;
|
||||
use Exception;
|
||||
use GrahamCampbell\Binput\Facades\Binput;
|
||||
use Illuminate\Database\QueryException;
|
||||
use Illuminate\Foundation\Bus\DispatchesJobs;
|
||||
use Illuminate\Http\Request;
|
||||
use Symfony\Component\HttpKernel\Exception\BadRequestHttpException;
|
||||
@@ -63,7 +63,7 @@ class ComponentGroupController extends AbstractApiController
|
||||
Binput::get('name'),
|
||||
Binput::get('order', 0)
|
||||
));
|
||||
} catch (Exception $e) {
|
||||
} catch (QueryException $e) {
|
||||
throw new BadRequestHttpException();
|
||||
}
|
||||
|
||||
@@ -85,7 +85,7 @@ class ComponentGroupController extends AbstractApiController
|
||||
Binput::get('name'),
|
||||
Binput::get('order', 0)
|
||||
));
|
||||
} catch (Exception $e) {
|
||||
} catch (QueryException $e) {
|
||||
throw new BadRequestHttpException();
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user