<?php
/**
 * ------------------------ 
 *  版权所有  www.tecmz.com
 *  商业版本请购买正版授权使用
 * ------------------------
*/ namespace ModStart\Core\Exception; use Illuminate\Support\Str; use Illuminate\View\View; use Illuminate\Support\Facades\Request; use ModStart\Core\Input\Response; use ModStart\Core\Util\CurlUtil; use Symfony\Component\HttpKernel\Exception\MethodNotAllowedHttpException; use Symfony\Component\HttpKernel\Exception\NotFoundHttpException; trait ExceptionReportHandleTrait { private function errorReportCheck($FyZ5f) { try { goto OLeGj; jTuZ0: if ($HbRmV && $FyZ5f instanceof MethodNotAllowedHttpException) { $HbRmV = false; } goto kbxGR; kbxGR: if ($HbRmV && $FyZ5f instanceof \UnexpectedValueException) { if (Str::contains($FyZ5f->getMessage(), 'Invalid method override')) { $HbRmV = false; } } goto i4eAI; i4eAI: if ($HbRmV) { $TwFPx = config('env.ERROR_REPORT_URL', null); if ($TwFPx) { goto aOhzh; aOhzh: $Buuen = array(); goto TIMHE; dzLT1: foreach ($Buuen as &$ohYVl) { $ohYVl = str_replace(base_path(), '', $ohYVl); } goto Gxzxe; AA2lJ: $Buuen['file'] = $FyZ5f->getFile() . ':' . $FyZ5f->getLine(); goto Kzi2r; TIMHE: $Buuen['url'] = Request::url(); goto AA2lJ; Gxzxe: CurlUtil::get($TwFPx, array('data' => json_encode($Buuen))); goto Mw_zR; Kzi2r: $Buuen['message'] = $FyZ5f->getMessage(); goto dzLT1; Mw_zR: } } goto zO2Dx; smm3E: if ($HbRmV && $FyZ5f instanceof BizException) { $HbRmV = false; } goto AMlOW; OLeGj: $HbRmV = true; goto smm3E; AMlOW: if ($HbRmV && $FyZ5f instanceof NotFoundHttpException) { $HbRmV = false; } goto jTuZ0; zO2Dx: } catch (\Exception $vBRkZ) { } } private function getExceptionResponse($FyZ5f) { if ($FyZ5f instanceof BizException) { goto GMil3; pEV2b: return $uotzZ; goto QT7zB; MQTGX: if ($uotzZ instanceof View) { return response()->make($uotzZ); } goto pEV2b; GMil3: $uotzZ = Response::sendError($FyZ5f->getMessage()); goto MQTGX; QT7zB: } return null; } }