PluginProbe
WooCommerce / 11.1.0-beta.1
WooCommerce v11.1.0-beta.1
11.1.0 11.1.0-rc.2 11.1.0-rc.1 11.1.0-beta.2 11.1.0-beta.1 11.0.1 11.0.0 11.0.0-rc.3 11.0.0-rc.2 11.0.0-rc.1 11.0.0-beta.2 11.0.0-beta.1 10.9.4 10.9.3 10.9.2 10.9.1 10.9.0 10.9.0-rc.1 10.9.0-beta.2 10.9.0-beta.1 10.8.1 10.8.0 10.8.0-rc.1 10.8.0-beta.2 10.8.0-beta.1 All 648 releases
woocommerce / src / Api / NotFoundException.php
NotFoundException.php
33 lines 999 B
No matching file
Up and down to move Enter to open Esc to close
Raw Download Zip
1 <?php
2
3 declare(strict_types=1);
4
5 namespace Automattic\WooCommerce\Api;
6
7 /**
8 * Thrown to signal that the requested resource doesn't exist.
9 *
10 * Note: when the existence of a resource is itself sensitive (e.g. an order
11 * the caller has no business knowing about), prefer {@see UnauthorizedException}
12 * instead: leaking a 404 vs 401 distinction lets callers probe for resource
13 * existence.
14 *
15 * Wire shape: `extensions.code = 'NOT_FOUND'`, HTTP status 404.
16 */
17 class NotFoundException extends ApiException {
18 /**
19 * Constructor.
20 *
21 * @param string $message The error message.
22 * @param array $extensions Additional error metadata to surface in the GraphQL `extensions` object.
23 * @param ?\Throwable $previous The previous throwable for chaining.
24 */
25 public function __construct(
26 string $message = 'Resource not found.',
27 array $extensions = array(),
28 ?\Throwable $previous = null,
29 ) {
30 parent::__construct( $message, 'NOT_FOUND', $extensions, 404, $previous );
31 }
32 }
33