]> BookStack Code Mirror - bookstack/blobdiff - app/Exceptions/Handler.php
Added social sign in
[bookstack] / app / Exceptions / Handler.php
index 7401affed4f5ff08a3d20994bc9661a59aedc5c2..d18a9bd2c0a2f66a7b28eb142f1d09c42a5e376c 100644 (file)
@@ -22,8 +22,7 @@ class Handler extends ExceptionHandler
      *
      * This is a great spot to send exceptions to Sentry, Bugsnag, etc.
      *
-     * @param  \Exception  $e
-     * @return void
+     * @param  \Exception $e
      */
     public function report(Exception $e)
     {
@@ -39,6 +38,11 @@ class Handler extends ExceptionHandler
      */
     public function render($request, Exception $e)
     {
+        if($e instanceof NotifyException) {
+            \Session::flash('error', $e->message);
+            return response()->redirectTo($e->redirectLocation);
+        }
+
         return parent::render($request, $e);
     }
 }