Improved api validation
This commit is contained in:
@@ -15,8 +15,8 @@ use CachetHQ\Cachet\Commands\Metric\AddMetricCommand;
|
||||
use CachetHQ\Cachet\Commands\Metric\RemoveMetricCommand;
|
||||
use CachetHQ\Cachet\Commands\Metric\UpdateMetricCommand;
|
||||
use CachetHQ\Cachet\Models\Metric;
|
||||
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;
|
||||
@@ -80,7 +80,7 @@ class MetricController extends AbstractApiController
|
||||
Binput::get('display_chart'),
|
||||
Binput::get('places', 2)
|
||||
));
|
||||
} catch (Exception $e) {
|
||||
} catch (QueryException $e) {
|
||||
throw new BadRequestHttpException();
|
||||
}
|
||||
|
||||
@@ -107,7 +107,7 @@ class MetricController extends AbstractApiController
|
||||
Binput::get('display_chart'),
|
||||
Binput::get('places', 2)
|
||||
));
|
||||
} catch (Exception $e) {
|
||||
} catch (QueryException $e) {
|
||||
throw new BadRequestHttpException();
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user