for testing and deploying your application
for finding and fixing issues
for empowering human code reviews
<?php
declare(strict_types=1);
namespace LauLamanApps\eCurring\Http\Adapter\Guzzle\Exception;
use GuzzleHttp\Exception\RequestException;
use LauLamanApps\eCurring\Exception\eCurringException;
final class Handler
{
/**
* @throws eCurringException
* @throws NotFoundException
*/
public static function handleRequestException(RequestException $exception): void
switch ($exception->getCode()) {
case 400:
throw new BadRequestException();
case 404:
throw new NotFoundException();
}
throw new eCurringException($exception->getMessage(), $exception->getCode(), $exception);