Run resolvers in the presence of upstream failures.
Chalk returns an error channel in addition the requested feature values.
There are several types of errors one could expect:
Request errors are raised before execution of your resolver code. They may occur due to invalid feature names in the input or a request that cannot be satisfied by the resolvers you have defined.
Field errors are raised while running a feature resolver
for a particular field.
For this type of error, you’ll find a feature and resolver
attribute in the error type.
When a feature resolver crashes, you will receive null value
in the response.
To differentiate from a resolver returning a null value and
a failure in the resolver, you need to check the error schema.
Network errors are thrown outside your resolvers. For example, your request was unauthenticated, connection failed, or an error occurred within Chalk.
The online query interface for resolvers returns the following schema:
dataFeatureResult[]The outputs features and any query metadata (discussed in detail at Query Basics.)
errorsChalkError[]?Errors encountered while running the resolvers. Each element in the list is a ChalkError. If no errors were encountered, this field is empty.
codeErrorCodeThe type of error, matching one of the error codes.
categoryErrorCode.kindThe category of the error, given in the type field for the error codes. This will be one of “REQUEST”, “NETWORK”, and “FIELD”.
messagestringA readable description of the error message.
exceptionobject?The exception that caused the failure, if applicable.
kindstringThe name of the class of the exception.
messagestringThe message taken from the exception.
stacktracestringThe stacktrace produced by the code.
featurestring?The fully qualified name of the failing feature, eg.
user.identity.has_voip_phone.
resolverstring?The fully qualified name of the failing resolver, eg.
my.project.get_fraud_score.
PARSE_FAILEDREQUESTThe query contained features that do not exist.
RESOLVER_NOT_FOUNDREQUESTA resolver was required as part of running the dependency graph that could not be found.
INVALID_QUERYREQUESTThe query is invalid. All supplied features need to be rooted in the same top-level entity.
VALIDATION_FAILEDFIELDA feature value did not match the expected schema (eg. incompatible type “int”; expected “str”)
RESOLVER_FAILEDFIELDThe resolver for a feature errored.
RESOLVER_TIMED_OUTFIELDThe resolver for a feature timed out.
UPSTREAM_FAILEDFIELDA crash in a resolver that was to produce an input for the resolver crashed, and so the resolver could not run crashed, and so the resolver could not run.
UNAUTHENTICATEDNETWORKThe request was submitted with an invalid authentication header.
UNAUTHORIZEDNETWORKThe request has credentials that do not provide the required authorization to execute an operation.
INTERNAL_SERVER_ERRORNETWORKAn unspecified error occurred.