Skip to content

Commit 49cbe77

Browse files
committed
BUG#AC-8623: Address Error Handling functionality, lost due to Backward Compatibility Issue in Webonyx GraphQL Library
1 parent 83b7f30 commit 49cbe77

File tree

1 file changed

+14
-1
lines changed

1 file changed

+14
-1
lines changed

lib/internal/Magento/Framework/GraphQl/Exception/GraphQlNoSuchEntityException.php

Lines changed: 14 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,8 @@
77

88
namespace Magento\Framework\GraphQl\Exception;
99

10+
use GraphQL\Error\ClientAware;
11+
use GraphQL\Error\ProvidesExtensions;
1012
use Magento\Framework\Exception\NoSuchEntityException;
1113
use Magento\Framework\Phrase;
1214

@@ -15,7 +17,7 @@
1517
*
1618
* @api
1719
*/
18-
class GraphQlNoSuchEntityException extends NoSuchEntityException implements \GraphQL\Error\ClientAware
20+
class GraphQlNoSuchEntityException extends NoSuchEntityException implements ClientAware, ProvidesExtensions
1921
{
2022
const EXCEPTION_CATEGORY = 'graphql-no-such-entity';
2123

@@ -53,4 +55,15 @@ public function getCategory(): string
5355
{
5456
return self::EXCEPTION_CATEGORY;
5557
}
58+
59+
/**
60+
* Get error category
61+
*
62+
* @return array
63+
*/
64+
public function getExtensions(): array
65+
{
66+
$exceptionCategory['category'] = $this->getCategory();
67+
return $exceptionCategory;
68+
}
5669
}

0 commit comments

Comments
 (0)