#![allow(missing_docs)]
pub use error_chain::bail;
use error_chain::error_chain;
error_chain! {
errors {
InvalidEnvVarType(var_name: String, expected: String) {
description("invalid environment variable type")
display(
"invalid environment variable type for variable '{var_name}', expected '{expected}'",
var_name=var_name,
expected=expected
)
}
GraphQLContextNotFound(elem_name: String) {
description("required graphql context element not found")
display("required graphql context element '{}' not found", elem_name)
}
MutexPoisoned(mutex_name: String) {
description("mutex poisoned")
display("mutex '{}' poisoned", mutex_name)
}
SubscriptionDataPublishFailed {
description("failed to publish data to the subscriptions server")
display("failed to publish data to the subscriptions server, this is most likely due to an authentication failure")
}
InvalidDatetimeIntervalIndicator(indicator: String) {
description("invalid indicator in timestring")
display("invalid indicator '{}' in timestring, must be one of: s, m, h, d, w, M, y", indicator)
}
Unauthorised {
description("unauthorised access attempt")
display("unable to comply with request due to lack of valid and sufficient authentication")
}
IncompleteBuilderFields {
description("not all required builder fields were instantiated")
display("some required builder fields haven't been instantiated")
}
HttpResponseBuilderFailed {
description("the builder for an http response (netlify_lambda_http) returned an error")
display("the builder for an http response (netlify_lambda_http) returned an error")
}
InvokedSubscriptionsServerWithInvalidOptions {
description("you tried to create a subscriptions server without configuring it in the options")
display("you tried to create a subscriptions server without configuring it in the options")
}
AttemptedPlaygroundInProduction {
description("you tried to initialize the GraphQL playground in production, which is not supported due to authentication issues")
display("you tried to initialize the GraphQL playground in production, which is not supported due to authentication issues")
}
IntegrationError(message: String, integration_name: String) {
description("an error occurred in one of Diana's integration libraries")
display(
"the following error occurred in the '{integration_name}' integration library: {message}",
integration_name=integration_name,
message=message
)
}
}
foreign_links {
Io(::std::io::Error);
EnvVar(::std::env::VarError);
Reqwest(::reqwest::Error);
Json(::serde_json::Error);
JsonWebToken(::jsonwebtoken::errors::Error);
}
}
pub type GQLResult<T> = async_graphql::Result<T>;
pub type GQLError = async_graphql::Error;