1 | import devAssert from '../jsutils/devAssert';
|
2 |
|
3 |
|
4 |
|
5 |
|
6 |
|
7 | export function formatError(error) {
|
8 | error || devAssert(0, 'Received null or undefined error.');
|
9 | var message = error.message || 'An unknown error occurred.';
|
10 | var locations = error.locations;
|
11 | var path = error.path;
|
12 | var extensions = error.extensions;
|
13 | return extensions ? {
|
14 | message: message,
|
15 | locations: locations,
|
16 | path: path,
|
17 | extensions: extensions
|
18 | } : {
|
19 | message: message,
|
20 | locations: locations,
|
21 | path: path
|
22 | };
|
23 | }
|
24 |
|
25 |
|
26 |
|