-
Notifications
You must be signed in to change notification settings - Fork 458
/
Copy pathGeneralException.php
executable file
·52 lines (46 loc) · 1.02 KB
/
GeneralException.php
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
<?php
namespace App\Exceptions;
use Exception;
use Throwable;
/**
* Class GeneralException.
*/
class GeneralException extends Exception
{
/**
* @var
*/
public $message;
/**
* GeneralException constructor.
*
* @param string $message
* @param int $code
* @param Throwable|null $previous
*/
public function __construct($message = '', $code = 0, Throwable $previous = null)
{
parent::__construct($message, $code, $previous);
}
/**
* Report the exception.
*/
public function report()
{
//
}
/**
* Render the exception into an HTTP response.
*
* @param \Illuminate\Http\Request
* @return \Illuminate\Http\Response
*/
public function render($request)
{
// All instances of GeneralException redirect back with a flash message to show a bootstrap alert-error
return redirect()
->back()
->withInput()
->withFlashDanger($this->message);
}
}