Vous ne pouvez pas sélectionner plus de 25 sujets Les noms de sujets doivent commencer par une lettre ou un nombre, peuvent contenir des tirets ('-') et peuvent comporter jusqu'à 35 caractères.

TooManyRequestsHttpException.php 1.0KB

123456789101112131415161718192021222324252627282930313233
  1. <?php
  2. /**
  3. * @link http://www.yiiframework.com/
  4. * @copyright Copyright (c) 2008 Yii Software LLC
  5. * @license http://www.yiiframework.com/license/
  6. */
  7. namespace yii\web;
  8. /**
  9. * TooManyRequestsHttpException represents a "Too Many Requests" HTTP exception with status code 429
  10. *
  11. * Use this exception to indicate that a client has made too many requests in a
  12. * given period of time. For example, you would throw this exception when
  13. * 'throttling' an API user.
  14. *
  15. * @link http://tools.ietf.org/search/rfc6585#section-4
  16. * @author Dan Schmidt <danschmidt5189@gmail.com>
  17. * @since 2.0
  18. */
  19. class TooManyRequestsHttpException extends HttpException
  20. {
  21. /**
  22. * Constructor.
  23. * @param string $message error message
  24. * @param integer $code error code
  25. * @param \Exception $previous The previous exception used for the exception chaining.
  26. */
  27. public function __construct($message = null, $code = 0, \Exception $previous = null)
  28. {
  29. parent::__construct(429, $message, $code, $previous);
  30. }
  31. }