Files
Global-Jain/app/Exceptions/GeneralException.php

51 lines
1.0 KiB
PHP
Raw Normal View History

2025-11-05 10:37:10 +05:30
<?php
namespace App\Exceptions;
use Exception;
use Throwable;
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()
->with('toast_warning', $this->message);
}
}