1: <?php
2:
3: /**
4: * This file is part of the Nette Framework (https://nette.org)
5: *
6: * Copyright (c) 2004 David Grudl (http://davidgrudl.com)
7: *
8: * For the full copyright and license information, please view
9: * the file license.txt that was distributed with this source code.
10: * @package Nette\Application
11: */
12:
13:
14:
15: /**
16: * Bad HTTP / presenter request exception.
17: *
18: * @author David Grudl
19: * @package Nette\Application
20: */
21: class NBadRequestException extends Exception
22: {
23: /** @var int */
24: protected $defaultCode = 404;
25:
26:
27: public function __construct($message = '', $code = 0, Exception $previous = NULL)
28: {
29: if ($code < 200 || $code > 504) {
30: $code = $this->defaultCode;
31: }
32:
33: if (PHP_VERSION_ID < 50300) {
34: $this->previous = $previous;
35: parent::__construct($message, $code);
36: } else {
37: parent::__construct($message, $code, $previous);
38: }
39: }
40:
41: }
42: