Skip to content

Commit

Permalink
Merge pull request #1114 from prabhat-webkul/fix-exception
Browse files Browse the repository at this point in the history
Fixed #1113
  • Loading branch information
devansh-webkul authored Jun 12, 2024
2 parents d36d7d7 + 1f5ae2d commit 9424cef
Showing 1 changed file with 13 additions and 4 deletions.
17 changes: 13 additions & 4 deletions packages/Webkul/Admin/src/Exceptions/Handler.php
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,9 @@

use App\Exceptions\Handler as AppExceptionHandler;
use Illuminate\Auth\AuthenticationException;
use PDOException;
use Illuminate\Container\Container;
use Illuminate\Database\Eloquent\ModelNotFoundException;
use PDOException;
use Symfony\Component\HttpKernel\Exception\HttpException;
use Throwable;

Expand Down Expand Up @@ -52,6 +52,17 @@ public function render($request, Throwable $exception)
return parent::render($request, $exception);
}

/**
* Report the exception.
*
* @param \Throwable $exception
* @return void
*/
public function report(Throwable $exception)
{
//
}

/**
* Convert an authentication exception into a response.
*
Expand Down Expand Up @@ -92,9 +103,7 @@ private function renderCustomResponse(Throwable $exception)

if ($exception instanceof ModelNotFoundException) {
return $this->response($path, 404);
}

if ($exception instanceof PDOException) {
} elseif ($exception instanceof PDOException || $exception instanceof \ParseError) {
return $this->response($path, 500);
}
}
Expand Down

0 comments on commit 9424cef

Please sign in to comment.