1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
#![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;