ClientAware.php
2 months ago
CoercionError.php
2 months ago
DebugFlag.php
2 months ago
Error.php
2 months ago
FormattedError.php
2 months ago
InvariantViolation.php
2 months ago
ProvidesExtensions.php
2 months ago
SerializationError.php
2 months ago
SyntaxError.php
2 months ago
UserError.php
2 months ago
Warning.php
2 months ago
ClientAware.php
22 lines
| 1 | <?php declare(strict_types=1); |
| 2 | |
| 3 | namespace Automattic\WooCommerce\Vendor\GraphQL\Error; |
| 4 | |
| 5 | /** |
| 6 | * Implementing ClientAware allows graphql-php to decide if this error is safe to be shown to clients. |
| 7 | * |
| 8 | * Only errors that both implement this interface and return true from `isClientSafe()` |
| 9 | * will retain their original error message during formatting. |
| 10 | * |
| 11 | * All other errors will have their message replaced with "Internal server error". |
| 12 | */ |
| 13 | interface ClientAware |
| 14 | { |
| 15 | /** |
| 16 | * Is it safe to show the error message to clients? |
| 17 | * |
| 18 | * @api |
| 19 | */ |
| 20 | public function isClientSafe(): bool; |
| 21 | } |
| 22 |