mirror of
https://github.com/snipe/snipe-it.git
synced 2025-03-05 20:52:15 -08:00
Make the 429 error less stupid
Signed-off-by: snipe <snipe@snipe.net>
This commit is contained in:
parent
50f55b4308
commit
2906a89442
|
@ -84,10 +84,12 @@ class Handler extends ExceptionHandler
|
||||||
switch ($e->getStatusCode()) {
|
switch ($e->getStatusCode()) {
|
||||||
case '404':
|
case '404':
|
||||||
return response()->json(Helper::formatStandardApiResponse('error', null, $statusCode . ' endpoint not found'), 404);
|
return response()->json(Helper::formatStandardApiResponse('error', null, $statusCode . ' endpoint not found'), 404);
|
||||||
|
case '429':
|
||||||
|
return response()->json(Helper::formatStandardApiResponse('error', null, 'Too many requests'), 429);
|
||||||
case '405':
|
case '405':
|
||||||
return response()->json(Helper::formatStandardApiResponse('error', null, 'Method not allowed'), 405);
|
return response()->json(Helper::formatStandardApiResponse('error', null, 'Method not allowed'), 405);
|
||||||
default:
|
default:
|
||||||
return response()->json(Helper::formatStandardApiResponse('error', null, $statusCode), 405);
|
return response()->json(Helper::formatStandardApiResponse('error', null, $statusCode), $statusCode);
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue