В вашем обработчике исключений Laravel вы можете обработать это исключение перед рендерингом и заменить это исключение на ваше собственное исключение.
В app / Exceptions / Handler.php
/**
* Render an exception into an HTTP response.
*
* @param \Illuminate\Http\Request $request
* @param \Exception $exception
* @return \Illuminate\Http\Response|\Illuminate\Http\JsonResponse
*/
public function render($request, Exception $exception)
{
if($exception instanceof ThrottleRequestsException) {
return parent::render(
$request, new ThrottleRequestsException(
'Your message',
$exception->getPrevious(),
$exception->getHeaders(),
$exception->getCode()
)
);
}
return parent::render($request, $exception);
}