1 |
efrain |
1 |
<?php
|
|
|
2 |
// This file is part of Moodle - http://moodle.org/
|
|
|
3 |
//
|
|
|
4 |
// Moodle is free software: you can redistribute it and/or modify
|
|
|
5 |
// it under the terms of the GNU General Public License as published by
|
|
|
6 |
// the Free Software Foundation, either version 3 of the License, or
|
|
|
7 |
// (at your option) any later version.
|
|
|
8 |
//
|
|
|
9 |
// Moodle is distributed in the hope that it will be useful,
|
|
|
10 |
// but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
|
11 |
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
|
12 |
// GNU General Public License for more details.
|
|
|
13 |
//
|
|
|
14 |
// You should have received a copy of the GNU General Public License
|
|
|
15 |
// along with Moodle. If not, see <http://www.gnu.org/licenses/>.
|
|
|
16 |
|
|
|
17 |
declare(strict_types=1);
|
|
|
18 |
|
|
|
19 |
namespace mod_edusharing;
|
|
|
20 |
|
|
|
21 |
use Exception;
|
|
|
22 |
use Throwable;
|
|
|
23 |
|
|
|
24 |
/**
|
|
|
25 |
* Class EduSharingUserException
|
|
|
26 |
*
|
|
|
27 |
* @author Marian Ziegler <ziegler@edu-sharing.net>
|
|
|
28 |
* @package mod_edusharing
|
|
|
29 |
*/
|
|
|
30 |
class EduSharingUserException extends Exception {
|
|
|
31 |
/**
|
|
|
32 |
* @var string|null
|
|
|
33 |
*/
|
|
|
34 |
private ?string $htmlmessage;
|
|
|
35 |
|
|
|
36 |
/**
|
|
|
37 |
* Function __construct
|
|
|
38 |
*
|
|
|
39 |
* @param string $message
|
|
|
40 |
* @param int $code
|
|
|
41 |
* @param Throwable|null $previous
|
|
|
42 |
* @param string|null $htmlmessage
|
|
|
43 |
*/
|
|
|
44 |
public function __construct(string $message = "", int $code = 0, ?Throwable $previous = null, ?string $htmlmessage = null) {
|
|
|
45 |
$this->htmlmessage = $htmlmessage;
|
|
|
46 |
parent::__construct($message, $code, $previous);
|
|
|
47 |
}
|
|
|
48 |
|
|
|
49 |
/**
|
|
|
50 |
* Function getHtmlMessage
|
|
|
51 |
*
|
|
|
52 |
* @return string|null
|
|
|
53 |
*/
|
|
|
54 |
public function get_html_message(): ?string {
|
|
|
55 |
return $this->htmlmessage;
|
|
|
56 |
}
|
|
|
57 |
}
|