Skip to content

Commit

Permalink
Merge pull request #75 from ahtinurme/main
Browse files Browse the repository at this point in the history
Extend the ExceptionHandler set in the project
  • Loading branch information
MohmmedAshraf authored Feb 16, 2024
2 parents 0eec39b + bc74f4f commit 2da3819
Showing 1 changed file with 14 additions and 2 deletions.
16 changes: 14 additions & 2 deletions src/Exceptions/TranslationsUIExceptionHandler.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,8 @@

namespace Outhebox\TranslationsUI\Exceptions;

use Illuminate\Foundation\Exceptions\Handler as ExceptionHandler;
use Illuminate\Foundation\Exceptions\Handler as BaseHandler;
use App\Exceptions\Handler;
use Illuminate\Http\JsonResponse;
use Illuminate\Http\Request;
use Illuminate\Http\Response;
Expand All @@ -11,7 +12,18 @@
use Symfony\Component\HttpKernel\Exception\HttpExceptionInterface;
use Throwable;

class TranslationsUIExceptionHandler extends ExceptionHandler
if (class_exists('App\Exceptions\Handler')) {
class ExtendedHandler extends Handler
{
// Extend the custom handler
}
} else {
class ExtendedHandler extends BaseHandler {
// Extend the default handler
}
}

class TranslationsUIExceptionHandler extends ExtendedHandler
{
public static function isTranslationsUIRequest(Request $request): bool
{
Expand Down

0 comments on commit 2da3819

Please sign in to comment.