Skip to content

Commit

Permalink
[ECVS-6] handle INVALID_INPUT fault code.
Browse files Browse the repository at this point in the history
  • Loading branch information
arslanim committed Dec 21, 2023
1 parent f4b901c commit 0f3fa09
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions src/FaultCodeExceptionFactory.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@

namespace rocketfellows\ViesVatValidationInterface;

use rocketfellows\ViesVatValidationInterface\exceptions\service\InvalidInputServiceException;
use rocketfellows\ViesVatValidationInterface\exceptions\service\UnknownServiceErrorException;
use rocketfellows\ViesVatValidationInterface\exceptions\VatNumberValidationException;

Expand All @@ -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();
}
}
}

0 comments on commit 0f3fa09

Please sign in to comment.