Du kan inte välja fler än 25 ämnen Ämnen måste starta med en bokstav eller siffra, kan innehålla bindestreck ('-') och vara max 35 tecken långa.

34 lines
1.0KB

  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. }