1: <?php
2: namespace Izberg\Exception;
3: use Exception;
4: use RuntimeException;
5:
6:
7: /**
8: * Represents an HTTP 40error.
9: */
10: class UnauthorizedException extends HttpException {
11: /**
12: * Constructor
13: *
14: * @param string $message If no message is given 'Unauthorized' will be the message
15: * @param string $code Status code, defaults to 401
16: */
17: public function __construct($message = null, $code = 401) {
18: if (empty($message)) {
19: $message = 'Unauthorized';
20: }
21: parent::__construct($message, $code);
22: }
23: }
24: