refactor: enhance plugin mechanism for better extensibility

This commit is contained in:
xboard committed 2025-01-26 02:31:57 +08:00
1 parent 421f50ce93
commit 29f838ee93
6 files changed
+144 -89

No files matched your search

+14
View File
@@ -3,6 +3,7 @@
namespace App\Exceptions;
use App\Helpers\ApiResponse;
use App\Services\Plugin\InterceptResponseException;
use Illuminate\Foundation\Exceptions\Handler as ExceptionHandler;
use Illuminate\Support\Arr;
use Illuminate\View\ViewException;
@@ -68,6 +69,19 @@ class Handler extends ExceptionHandler
return parent::render($request, $exception);
}
/**
* Register the exception handling callbacks for the application.
*/
public function register(): void
{
$this->reportable(function (Throwable $e) {
//
});
$this->renderable(function (InterceptResponseException $e) {
return $e->getResponse();
});
}
protected function convertExceptionToArray(Throwable $e)
{