diff --git a/src/FaultCodeExceptionFactory.php b/src/FaultCodeExceptionFactory.php index 4750f53..4e42760 100644 --- a/src/FaultCodeExceptionFactory.php +++ b/src/FaultCodeExceptionFactory.php @@ -2,6 +2,7 @@ namespace rocketfellows\ViesVatValidationInterface; +use rocketfellows\ViesVatValidationInterface\exceptions\service\InvalidInputServiceException; use rocketfellows\ViesVatValidationInterface\exceptions\service\UnknownServiceErrorException; use rocketfellows\ViesVatValidationInterface\exceptions\VatNumberValidationException; @@ -10,7 +11,11 @@ class FaultCodeExceptionFactory public function create(string $faultCode): VatNumberValidationException { // TODO: implement - - return new UnknownServiceErrorException(); + switch ($faultCode) { + case FaultCodes::INVALID_INPUT: + return new InvalidInputServiceException(); + default: + return new UnknownServiceErrorException(); + } } }