3 namespace BookStack\Exceptions;
6 use Illuminate\Contracts\Support\Responsable;
8 class NotifyException extends Exception implements Responsable
11 public $redirectLocation;
14 * NotifyException constructor.
16 public function __construct(string $message, string $redirectLocation = '/')
18 $this->message = $message;
19 $this->redirectLocation = $redirectLocation;
20 parent::__construct();
24 * Send the response for this type of exception.
28 public function toResponse($request)
30 $message = $this->getMessage();
32 if (!empty($message)) {
33 session()->flash('error', $message);
36 return redirect($this->redirectLocation);