Skip to content

Commit b7ff90f

Browse files
committed
Make InvalidArgument exception ClientAware
1 parent ca08783 commit b7ff90f

File tree

1 file changed

+13
-2
lines changed

1 file changed

+13
-2
lines changed

src/Exception/InvalidArgument.php

Lines changed: 13 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,13 +4,14 @@
44

55
namespace SimPod\GraphQLUtils\Exception;
66

7-
use Error;
7+
use Exception;
8+
use GraphQL\Error\ClientAware;
89
use SimPod\GraphQLUtils\Builder\TypeBuilder;
910
use Throwable;
1011

1112
use function Safe\sprintf;
1213

13-
final class InvalidArgument extends Error
14+
final class InvalidArgument extends Exception implements ClientAware
1415
{
1516
private function __construct(string $message = '', int $code = 0, ?Throwable $previous = null)
1617
{
@@ -29,4 +30,14 @@ public static function valueNotIso8601Compliant($invalidValue): self
2930
{
3031
return new self(sprintf('DateTime type expects input value to be ISO 8601 compliant. Given invalid value "%s"', (string) $invalidValue));
3132
}
33+
34+
public function isClientSafe(): bool
35+
{
36+
return true;
37+
}
38+
39+
public function getCategory(): string
40+
{
41+
return '';
42+
}
3243
}

0 commit comments

Comments
 (0)