Daniel Tschinder
6d45a22ba4
Always extract extensions from the original error if possible
...
ref: graphql/graphql-js#2d08496720088dbe65ebea312c8526bd48fb8ee8
2018-02-13 10:42:56 +01:00
Daniel Tschinder
cf276340a4
Fix printError/locations for multiple nodes.
...
If a GraphQLError represents multiple nodes across files (could happen for validation across multiple parsed files) then the reported locations and printError output can be incorrect for the second node. This ensures locations are derived from nodes whenever possible to get correct location and amends comment documentation.
ref: graphql/graphql-js#1131
2018-02-13 10:42:51 +01:00
Daniel Tschinder
15374a31dd
New: printError()
...
Lifted from / inspired by a similar change in graphql/graphql-js#722 , this creates a new function `printError()` (and uses it as the implementation for `GraphQLError#toString()`) which prints location information in the context of an error.
This is moved from the syntax error where it used to be hard-coded, so it may now be used to format validation errors, value coercion errors, or any other error which may be associated with a location.
ref: graphql/graphql-js
BREAKING CHANGE: The SyntaxError message does not contain the codeframe anymore and only the message, (string) $error will print the codeframe.
2018-02-12 12:23:39 +01:00
Daniel Tschinder
0c984a83bb
Allow constructing GraphQLError with single node.
...
A common case is encountering an error which blames to a single AST node. Ensure the GraphQLError constructor can handle this case.
ref: graphql/graphql-js#1123
2018-02-11 21:18:54 +01:00
Daniel Tschinder
c4f11a577e
Allow to extend GraphQL errors with additional properties
...
ref: graphql/graphql-js#928
2018-02-10 18:45:38 +01:00
Vladimir Razuvaev
a1e06b2e61
Account for query offset in files for errors
2017-09-20 18:36:19 +07:00
Vladimir Razuvaev
bd444752f8
Documentation and docblock improvements
2017-08-20 16:00:44 +07:00
Vladimir Razuvaev
1b4f983f3f
Improved docblock comments (suitable for reference docs generation)
2017-08-19 23:01:46 +07:00
Vladimir Razuvaev
03629c1e3c
Refactored error formatting (debugging part)
2017-08-17 18:49:17 +07:00
Vladimir Razuvaev
1d38643538
Ability to re-throw resolver exceptions
2017-08-17 03:01:23 +07:00
Vladimir Razuvaev
51e877bfba
Improving docblock comments
2017-08-17 02:15:49 +07:00
Vladimir Razuvaev
a50c9a4c1f
Renamed error category constants
2017-08-17 02:13:44 +07:00
Vladimir Razuvaev
b9d3a11785
Extracted lazy schema test; minor related refactoring
2017-08-14 20:41:08 +07:00
Vladimir Razuvaev
f9eb14869f
Removed callbacks in field types (previously deprecated in #35 )
2017-08-14 00:50:24 +07:00
Vladimir Razuvaev
6845b28a35
Deprecated GraphQL\Type\Definition\Config
( #148 )
2017-08-14 00:09:02 +07:00
Vladimir Razuvaev
34eae0b891
Schema validation + tests ( #148 )
2017-08-13 23:04:03 +07:00
Vladimir Razuvaev
f911fac7b1
Default error reporting now includes "category" key for every error
2017-08-08 02:02:07 +07:00
Vladimir Razuvaev
e7838d2253
Do not output trace for trivial errors even in debug mode
2017-07-25 20:08:34 +07:00
Vladimir Razuvaev
87c812b221
Better located error handling
2017-07-19 20:08:42 +07:00
Vladimir Razuvaev
38922dbbed
Default error formatter now returns "Internal server error" unless error is client-aware and safe to report directly to end-users
2017-07-18 20:57:30 +07:00
Vladimir Razuvaev
794d3672ef
Initial pass on standard server implementation (also deprecated current GraphQL\Server which is undocumented anyway)
2017-07-14 19:44:18 +07:00
Vladimir Razuvaev
aaa5b7af41
Global config; descriptor moved to appropriate namespace; minor cleanup
2017-07-12 13:16:34 +07:00
Vladimir Razuvaev
296544089c
Moved GraphQL\Utils to GraphQL\Utils\Utils
2017-07-10 19:53:46 +07:00
Vladimir Razuvaev
ed28deda81
Replaced trigger_error with Warning for resolveType warning
2017-07-10 19:38:12 +07:00
Vladimir Razuvaev
9f4980ce49
Fix for broken build on PHP < 5.6
2017-07-04 22:18:55 +07:00
Vladimir Razuvaev
90e1ea4d22
Added tools for warnings with ability to suppress them
2017-07-04 17:13:05 +07:00
Vladimir Razuvaev
c5484ae6f9
Convert error to warning for non-compliant usage of __ in names
2017-07-04 00:28:17 +07:00
Daniel Tschinder
65ef159ddc
Support PHP7 error exceptions everywhere
...
Also replace \Error with \Throwable
2017-06-25 07:33:28 -07:00
Jeremiah VALERIE
6d5b4e5a37
Use dedicated exception for scalar type parsing error
2017-05-29 10:32:48 +02:00
OwlyCode
d022b19b4e
Added compatibility with php7 error handling.
2017-01-12 17:18:25 +01:00
vladar
7c0aa4ceec
Better docs and comments on breaks and deprecations for 8.0
2016-11-25 16:37:00 +07:00
vladar
439959b292
Enforce input coercion rules
2016-11-19 04:15:40 +07:00
Andreas Heiberg
80a662564e
[style changes] arrays and callback
2016-11-16 17:29:50 +07:00
vladar
6c076e21d4
Another minor improvement to error formatting
2016-10-21 18:36:49 +07:00
vladar
927997a705
Various tools for better error reporting / formatting
2016-10-21 17:46:35 +07:00
vladar
2675b65095
Moved all error-related classes to separate namespace; fixed related broken tests
2016-10-21 16:40:56 +07:00