| 1 | <?php |
| 2 | |
| 3 | /** Detalle de los errores devueltos por un servicio. */ |
| 4 | class ProblemDetails extends Exception |
| 5 | { |
| 6 | |
| 7 | public int $status; |
| 8 | public string $title; |
| 9 | public ?string $type; |
| 10 | public ?string $detail; |
| 11 | |
| 12 | public function __construct( |
| 13 | int $status, |
| 14 | string $title, |
| 15 | ?string $type = null, |
| 16 | ?string $detail = null, |
| 17 | Throwable $previous = null |
| 18 | ) { |
| 19 | parent::__construct($title, $status, $previous); |
| 20 | $this->status = $status; |
| 21 | $this->type = $type; |
| 22 | $this->title = $title; |
| 23 | $this->detail = $detail; |
| 24 | } |
| 25 | } |
| 26 |