[增添]添加了datasource的setting数据库以及默认值
This commit is contained in:
27
vendor/danharrin/livewire-rate-limiting/src/Exceptions/TooManyRequestsException.php
vendored
Normal file
27
vendor/danharrin/livewire-rate-limiting/src/Exceptions/TooManyRequestsException.php
vendored
Normal file
@@ -0,0 +1,27 @@
|
||||
<?php
|
||||
|
||||
namespace DanHarrin\LivewireRateLimiting\Exceptions;
|
||||
|
||||
use Exception;
|
||||
|
||||
class TooManyRequestsException extends Exception
|
||||
{
|
||||
public $minutesUntilAvailable;
|
||||
|
||||
public function __construct(
|
||||
public $component,
|
||||
public $method,
|
||||
public $ip,
|
||||
public $secondsUntilAvailable,
|
||||
) {
|
||||
$this->minutesUntilAvailable = ceil($this->secondsUntilAvailable / 60);
|
||||
|
||||
parent::__construct(sprintf(
|
||||
'Too many requests from [%s] to method [%s] on component: [%s]. Retry in %d seconds.',
|
||||
$this->ip,
|
||||
$this->method,
|
||||
$this->component,
|
||||
$this->secondsUntilAvailable,
|
||||
));
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user