Update v1.0.6.6
This commit is contained in:
@@ -54,29 +54,30 @@ class Handler extends ExceptionHandler
|
||||
*/
|
||||
public function render($request, Exception $e)
|
||||
{
|
||||
if ($e instanceof \Tymon\JWTAuth\Exceptions\TokenExpiredException) {
|
||||
return response()->json(['message' => $e->getMessage(), 'code' => $e->getStatusCode()]);
|
||||
} elseif ($e instanceof \Tymon\JWTAuth\Exceptions\TokenInvalidException) {
|
||||
return response()->json(['message' => $e->getMessage(), 'code' => $e->getStatusCode()]);
|
||||
}
|
||||
// This is to check if the debug is true or false
|
||||
if (config('app.debug') == false) {
|
||||
// checking if the error is actually an error page or if its an system error page
|
||||
if ($this->isHttpException($e) && $e->getStatusCode() == 404) {
|
||||
return response()->view('errors.404', []);
|
||||
} else {
|
||||
// checking if the application is installed
|
||||
if (\Config::get('database.install') == 1) {
|
||||
// checking if the error log send to Ladybirdweb is enabled or not
|
||||
if (\Config::get('app.ErrorLog') == '%1%') {
|
||||
//$this->PhpMailController->sendmail($from = $this->PhpMailController->mailfrom('1', '0'), $to = ['name' => 'faveo logger', 'email' => 'faveoerrorlogger@gmail.com'], $message = ['subject' => 'Faveo downloaded from github has occured error', 'scenario' => 'error-report'], $template_variables = ['e' => $e]);
|
||||
}
|
||||
}
|
||||
|
||||
return response()->view('errors.500', []);
|
||||
}
|
||||
}
|
||||
// returns non oops error message
|
||||
// $phpmail = new PhpMailController;
|
||||
// if ($e instanceof \Tymon\JWTAuth\Exceptions\TokenExpiredException) {
|
||||
// return response()->json(['message' => $e->getMessage(), 'code' => $e->getStatusCode()]);
|
||||
// } elseif ($e instanceof \Tymon\JWTAuth\Exceptions\TokenInvalidException) {
|
||||
// return response()->json(['message' => $e->getMessage(), 'code' => $e->getStatusCode()]);
|
||||
// }
|
||||
// // This is to check if the debug is true or false
|
||||
// if (config('app.debug') == false) {
|
||||
// // checking if the error is actually an error page or if its an system error page
|
||||
// if ($this->isHttpException($e) && $e->getStatusCode() == 404) {
|
||||
// return response()->view('errors.404', []);
|
||||
// } else {
|
||||
// // checking if the application is installed
|
||||
// if (\Config::get('database.install') == 1) {
|
||||
// // checking if the error log send to Ladybirdweb is enabled or not
|
||||
// if (\Config::get('app.ErrorLog') == '1') {
|
||||
// $this->phpmail->sendmail($from = $this->PhpMailController->mailfrom('1', '0'), $to = ['name' => 'faveo logger', 'email' => 'faveoerrorlogger@gmail.com'], $message = ['subject' => 'Faveo downloaded from github has occured error', 'scenario' => 'error-report'], $template_variables = ['e' => $e]);
|
||||
// }
|
||||
// }
|
||||
//
|
||||
// return response()->view('errors.500', []);
|
||||
// }
|
||||
// }
|
||||
// // returns non oops error message
|
||||
return parent::render($request, $e);
|
||||
// checking if the error is related to http error i.e. page not found
|
||||
if ($this->isHttpException($e)) {
|
||||
|
Reference in New Issue
Block a user