exception
This commit is contained in:
@ -2,7 +2,11 @@
|
||||
|
||||
namespace App\Exceptions;
|
||||
|
||||
use App\Service\ReplyService;
|
||||
use Illuminate\Foundation\Exceptions\Handler as ExceptionHandler;
|
||||
use Illuminate\Http\Request;
|
||||
use Illuminate\Support\Facades\Log;
|
||||
use Symfony\Component\HttpKernel\Exception\NotFoundHttpException;
|
||||
use Throwable;
|
||||
|
||||
class Handler extends ExceptionHandler
|
||||
@ -23,8 +27,17 @@ class Handler extends ExceptionHandler
|
||||
*/
|
||||
public function register(): void
|
||||
{
|
||||
$this->renderable(function (NotFoundHttpException $e, Request $request) {
|
||||
return ReplyService::error( 'record not find');
|
||||
});
|
||||
|
||||
$this->renderable(function (AppException $e, Request $request) {
|
||||
Log::error($e->getTraceAsString());
|
||||
return ReplyService::error( $e->getMessage());
|
||||
});
|
||||
|
||||
$this->reportable(function (Throwable $e) {
|
||||
//
|
||||
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user