<?php
/**
 * ------------------------ 
 *  版权所有  www.tecmz.com
 *  商业版本请购买正版授权使用
 * ------------------------
*/ namespace ModStart\Core\Exception; use Illuminate\Database\Eloquent\ModelNotFoundException; use Illuminate\Support\Facades\Request; use Illuminate\Support\Facades\Route; use Illuminate\Support\Str; use Illuminate\View\View; use ModStart\Core\Input\Response; use ModStart\Core\Monitor\StatisticMonitor; use ModStart\Core\Util\CurlUtil; use Symfony\Component\HttpKernel\Exception\HttpException; use Symfony\Component\HttpKernel\Exception\MethodNotAllowedHttpException; use Symfony\Component\HttpKernel\Exception\NotFoundHttpException; trait ExceptionReportHandleTrait { private function errorReportCheck($U0Xul) { try { goto wk9_0; pWAH9: $F09iM['message'] = $U0Xul->getMessage(); goto fk3pO; OVHmS: if (empty($GW7zL)) { return; } goto Bby3L; Bby3L: $E5kIA = true; goto UbuMc; ChRZv: $F09iM['url'] = Request::url(); goto JGksj; WNhni: $F09iM = array(); goto ChRZv; JGksj: $F09iM['file'] = $U0Xul->getFile() . ':' . $U0Xul->getLine(); goto pWAH9; fk3pO: foreach ($F09iM as &$pk5fc) { $pk5fc = str_replace(base_path(), '', $pk5fc); } goto Cg6wV; wk9_0: $GW7zL = config('env.ERROR_REPORT_URL', null); goto OVHmS; eEPqZ: if ($E5kIA && $this->isExceptionIgnore($U0Xul)) { $E5kIA = false; } goto sBYu8; JKFiU: if ($E5kIA && $U0Xul instanceof MethodNotAllowedHttpException) { $E5kIA = false; } goto jjiRx; jjiRx: if ($E5kIA && $U0Xul instanceof HttpException) { switch ($U0Xul->getStatusCode()) { case 200: $E5kIA = false; break; } } goto eEPqZ; sBYu8: if (!$E5kIA) { return; } goto WNhni; Cg6wV: CurlUtil::get($GW7zL, array('data' => json_encode($F09iM))); goto wJZGe; UbuMc: if ($E5kIA && $U0Xul instanceof BizException) { $E5kIA = false; } goto N1_Iz; N1_Iz: if ($E5kIA && $U0Xul instanceof NotFoundHttpException) { $E5kIA = false; } goto JKFiU; wJZGe: } catch (\Exception $tZVhb) { } } private function isExceptionIgnore($U0Xul) { if ($U0Xul instanceof \UnexpectedValueException) { if (Str::contains($U0Xul->getMessage(), 'Invalid method override')) { return true; } } return false; } private function getExceptionResponse($U0Xul) { goto XQ0xv; Ff228: try { if (StatisticMonitor::isEnable()) { goto eU_SN; qRRP3: $igVv7 = \ModStart\Core\Input\Request::domain(); goto A9gWG; Rt3Kp: $FvLkj = Route::currentRouteAction(); goto qRRP3; ww8Jl: $iERFh = $gSoa2->url(); goto HdytV; A9gWG: StatisticMonitor::tick($igVv7, "{$hiFdg}." . $FvLkj, $oWzL0, false, 500); goto qgCGk; eU_SN: $gSoa2 = \ModStart\Core\Input\Request::instance(); goto XMWVJ; HdytV: $hiFdg = $gSoa2->method(); goto Rt3Kp; XMWVJ: $oWzL0 = round((microtime(true) - LARAVEL_START) * 1000, 2); goto ww8Jl; qgCGk: } } catch (\Exception $tZVhb) { } goto ftaBN; XQ0xv: if ($U0Xul instanceof BizException) { goto VsuO_; sEPmN: if ($N2Xaa instanceof View) { return response()->make($N2Xaa); } goto d_LxW; brZka: $N2Xaa = Response::sendError($U0Xul->getMessage()); goto ul2nk; d_LxW: return $N2Xaa; goto zTs9U; ul2nk: if (!\ModStart\Core\Input\Request::isAjax()) { if (!empty($WSySa['view'])) { $N2Xaa = view($WSySa['view'], array('_viewFrame' => 'theme.default.pc.frame', 'msg' => $U0Xul->getMessage())); } } goto sEPmN; VsuO_: $WSySa = $U0Xul->param; goto brZka; zTs9U: } else { if ($U0Xul instanceof MethodNotAllowedHttpException) { return Response::page404(); } elseif ($U0Xul instanceof NotFoundHttpException) { if (\ModStart\Core\Input\Request::isAjax()) { return Response::page404(); } return null; } elseif ($U0Xul instanceof ModelNotFoundException) { return null; } else { if ($U0Xul instanceof HttpException) { switch ($U0Xul->getStatusCode()) { case 200: goto QIWqL; QIWqL: if (\ModStart\Core\Input\Request::isJsonp()) { $N2Xaa = Response::generateError($U0Xul->getMessage()); return Response::jsonp($N2Xaa); } goto PtRJr; ecXWE: return $N2Xaa; goto uVRzA; LTVw4: if ($N2Xaa instanceof View) { return response()->make($N2Xaa); } goto ecXWE; PtRJr: $N2Xaa = Response::sendError($U0Xul->getMessage()); goto LTVw4; uVRzA: } } else { if ($U0Xul instanceof \UnexpectedValueException) { if (Str::contains($U0Xul->getMessage(), 'Invalid method override')) { return Response::page404(); } } } } } goto Ff228; ftaBN: return null; goto Hv_BM; Hv_BM: } }