Skip to content

Commit

Permalink
Updated documentation
Browse files Browse the repository at this point in the history
  • Loading branch information
vladar committed Jun 21, 2020
1 parent bb3178d commit e709615
Show file tree
Hide file tree
Showing 3 changed files with 164 additions and 172 deletions.
10 changes: 5 additions & 5 deletions docs/error-handling.md
Original file line number Diff line number Diff line change
Expand Up @@ -93,9 +93,9 @@ GraphQL\Error\FormattedError::setInternalErrorMessage("Unexpected error");
During development or debugging use `$result->toArray(DebugFlag::INCLUDE_DEBUG_MESSAGE)` to add **debugMessage** key to
each formatted error entry. If you also want to add exception trace - pass flags instead:

```
use GraphQL\Error\Debug;
$debug = Debug::INCLUDE_DEBUG_MESSAGE | Debug::INCLUDE_TRACE;
```php
use GraphQL\Error\DebugFlag;
$debug = DebugFlag::INCLUDE_DEBUG_MESSAGE | DebugFlag::INCLUDE_TRACE;
$result = GraphQL::executeQuery(/*args*/)->toArray($debug);
```

Expand Down Expand Up @@ -126,8 +126,8 @@ If you prefer the first resolver exception to be re-thrown, use following flags:
```php
<?php
use GraphQL\GraphQL;
use GraphQL\Error\Debug;
$debug = Debug::INCLUDE_DEBUG_MESSAGE | Debug::RETHROW_INTERNAL_EXCEPTIONS;
use GraphQL\Error\DebugFlag;
$debug = DebugFlag::INCLUDE_DEBUG_MESSAGE | DebugFlag::RETHROW_INTERNAL_EXCEPTIONS;

// Following will throw if there was an exception in resolver during execution:
$result = GraphQL::executeQuery(/*args*/)->toArray($debug);
Expand Down
Loading

0 comments on commit e709615

Please sign in to comment.