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