File tree Expand file tree Collapse file tree 3 files changed +15
-10
lines changed
Expand file tree Collapse file tree 3 files changed +15
-10
lines changed Original file line number Diff line number Diff line change 1515 "require" : {
1616 "php" : " ^7.3||^8.0" ,
1717 "thecodingmachine/safe" : " ^1.0.2" ,
18- "webonyx/graphql-php" : " ^0.12||^0.13 "
18+ "webonyx/graphql-php" : " ^14.0 "
1919 },
2020 "require-dev" : {
2121 "doctrine/coding-standard" : " ^8.1" ,
Original file line number Diff line number Diff line change 44
55namespace SimPod \GraphQLUtils \Error ;
66
7+ use GraphQL \Error \DebugFlag ;
8+ use Throwable ;
9+
710class FormattedError extends \GraphQL \Error \FormattedError
811{
912 /**
1013 * {@inheritdoc}
1114 */
12- public static function createFromException ($ e , $ debug = false , $ internalErrorMessage = null ): array
15+ public static function createFromException (Throwable $ exception , int $ debug = DebugFlag:: NONE , $ internalErrorMessage = null ): array
1316 {
14- $ arrayError = parent ::createFromException ($ e , $ debug , $ internalErrorMessage );
17+ $ arrayError = parent ::createFromException ($ exception , $ debug , $ internalErrorMessage );
1518
16- if ($ e instanceof \GraphQL \Error \Error && $ e ->getPrevious () instanceof Error) {
17- $ arrayError ['extensions ' ]['type ' ] = $ e ->getPrevious ()->getType ();
19+ if ($ exception instanceof \GraphQL \Error \Error && $ exception ->getPrevious () instanceof Error) {
20+ $ arrayError ['extensions ' ]['type ' ] = $ exception ->getPrevious ()->getType ();
1821 }
1922
2023 return $ arrayError ;
Original file line number Diff line number Diff line change 55namespace SimPod \GraphQLUtils \Tests \Error ;
66
77use Exception ;
8+ use GraphQL \Error \DebugFlag ;
89use GraphQL \Error \Error ;
910use PHPUnit \Framework \TestCase ;
1011use SimPod \GraphQLUtils \Error \FormattedError ;
@@ -38,7 +39,7 @@ public function testDebug() : void
3839 'category ' => 'internal ' ,
3940 ],
4041 ],
41- FormattedError::createFromException ($ exception , true )
42+ FormattedError::createFromException ($ exception , DebugFlag:: INCLUDE_DEBUG_MESSAGE )
4243 );
4344 }
4445
@@ -55,7 +56,7 @@ public function testInternalMessageModification() : void
5556 ],
5657 FormattedError::createFromException (
5758 $ exception ,
58- false ,
59+ DebugFlag:: NONE ,
5960 'Try grilling smoothie jumbled with salad cream, decorateed with green curry. '
6061 )
6162 );
@@ -67,10 +68,11 @@ public function testGraphQLCustomError() : void
6768 {
6869 public function __construct ()
6970 {
70- parent ::__construct (' Error Message ' ,
71- null ,
71+ parent ::__construct (
72+ ' Error Message ' ,
7273 null ,
7374 null ,
75+ [],
7476 null ,
7577 new CustomError ('' ));
7678 }
@@ -84,7 +86,7 @@ public function __construct()
8486 'type ' => 'CUSTOM_ERROR ' ,
8587 ],
8688 ],
87- FormattedError::createFromException ($ error , false )
89+ FormattedError::createFromException ($ error , DebugFlag:: NONE )
8890 );
8991 }
9092}
You can’t perform that action at this time.
0 commit comments