3 namespace BookStack\Exceptions;
6 use Illuminate\Contracts\Support\Responsable;
8 class PrettyException extends Exception implements Responsable
13 protected $subtitle = null;
18 protected $details = null;
21 * Render a response for when this exception occurs.
25 public function toResponse($request)
27 $code = ($this->getCode() === 0) ? 500 : $this->getCode();
29 return response()->view('errors.' . $code, [
30 'message' => $this->getMessage(),
31 'subtitle' => $this->subtitle,
32 'details' => $this->details,
36 public function setSubtitle(string $subtitle): self
38 $this->subtitle = $subtitle;
43 public function setDetails(string $details): self
45 $this->details = $details;