• Home
  • Features
  • Pricing
  • Docs
  • Announcements
  • Sign In

getdozer / dozer / 5623158752

pending completion
5623158752

push

github

web-flow
Prepare v0.1.30 (#1778)

43316 of 55993 relevant lines covered (77.36%)

25978.5 hits per line

Source File
Press 'n' to go to next uncovered line, 'b' for previous

0.0
/dozer-cli/src/errors.rs
1
#![allow(clippy::enum_variant_names)]
2

3
use glob::{GlobError, PatternError};
4
use std::io;
5
use std::path::PathBuf;
6

7
use dozer_api::{
8
    errors::{ApiError, AuthError, GenerationError, GrpcError},
9
    rest::DOZER_SERVER_NAME_HEADER,
10
};
11
use dozer_cache::dozer_log::{errors::SchemaError, storage};
12
use dozer_cache::errors::CacheError;
13
use dozer_core::errors::ExecutionError;
14
use dozer_ingestion::errors::ConnectorError;
15
use dozer_sql::pipeline::errors::PipelineError;
16
use dozer_types::errors::internal::BoxedError;
17
use dozer_types::thiserror::Error;
18
use dozer_types::{serde_yaml, thiserror};
19

20
use crate::pipeline::connector_source::ConnectorSourceFactoryError;
21

×
22
#[derive(Error, Debug)]
×
23
pub enum OrchestrationError {
24
    #[error("Failed to write config yaml: {0:?}")]
25
    FailedToWriteConfigYaml(#[source] serde_yaml::Error),
26
    #[error("File system error {0:?}: {1}")]
27
    FileSystem(PathBuf, std::io::Error),
28
    #[error("Failed to find build for endpoint {0}")]
29
    NoBuildFound(String),
30
    #[error("Failed to create log: {0}")]
31
    CreateLog(#[from] dozer_cache::dozer_log::replication::Error),
32
    #[error("Failed to login: {0}")]
33
    CloudLoginFailed(#[from] CloudLoginError),
34
    #[error("Credential Error: {0}")]
35
    CredentialError(#[from] CloudCredentialError),
36
    #[error("Failed to build: {0}")]
37
    BuildFailed(#[from] BuildError),
38
    #[error("Failed to generate token: {0}")]
39
    GenerateTokenFailed(#[source] AuthError),
40
    #[error("Missing api config or security input")]
41
    MissingSecurityConfig,
42
    #[error("Cloud service error: {0}")]
43
    CloudError(#[from] CloudError),
44
    #[error("Failed to initialize api server: {0}")]
45
    ApiServerFailed(#[from] ApiError),
46
    #[error("Failed to initialize grpc server: {0}")]
47
    GrpcServerFailed(#[from] GrpcError),
48
    #[error("Failed to initialize internal server: {0}")]
49
    InternalServerFailed(#[source] tonic::transport::Error),
50
    #[error("{0}: Failed to initialize cache. Have you run `dozer build`?")]
51
    CacheInitFailed(#[source] CacheError),
52
    #[error("Failed to build cache {0} from log: {1}")]
53
    CacheBuildFailed(String, #[source] CacheError),
54
    #[error("Cache {0} has reached its maximum size. Try to increase `cache_max_map_size` in the config.")]
55
    CacheFull(String),
56
    #[error("Internal thread panic: {0}")]
57
    JoinError(#[source] tokio::task::JoinError),
58
    #[error("Connector source factory error: {0}")]
59
    ConnectorSourceFactory(#[from] ConnectorSourceFactoryError),
60
    #[error(transparent)]
61
    ExecutionError(#[from] ExecutionError),
62
    #[error(transparent)]
63
    ConnectorError(#[from] ConnectorError),
64
    #[error(transparent)]
65
    PipelineError(#[from] PipelineError),
66
    #[error(transparent)]
67
    CliError(#[from] CliError),
68
    #[error("Source validation failed")]
69
    SourceValidationError,
70
    #[error("Pipeline validation failed")]
71
    PipelineValidationError,
72
    #[error("Table name specified in endpoint not found: {0:?}")]
73
    EndpointTableNotFound(String),
74
    #[error("Duplicate table name found: {0:?}")]
75
    DuplicateTable(String),
76
    #[error("No endpoints initialized in the config provided")]
77
    EmptyEndpoints,
78
    #[error(transparent)]
79
    CloudContextError(#[from] CloudContextError),
80
    #[error("Failed to read organisation name. Error: {0}")]
81
    FailedToReadOrganisationName(#[source] io::Error),
×
82
}
83

84
#[derive(Error, Debug)]
×
85
pub enum CliError {
86
    #[error("Configuration file path not provided")]
87
    ConfigurationFilePathNotProvided,
88
    #[error("Can't find the configuration file(s) at: {0:?}")]
89
    FailedToFindConfigurationFiles(String),
90
    #[error("Unknown Command: {0:?}")]
91
    UnknownCommand(String),
92
    #[error("Failed to parse dozer config: {0:?}")]
93
    FailedToParseYaml(#[source] BoxedError),
94
    #[error("Failed to validate dozer config: {0:?}")]
95
    FailedToParseValidateYaml(#[source] BoxedError),
96
    #[error("Failed to read line: {0}")]
97
    ReadlineError(#[from] rustyline::error::ReadlineError),
98
    #[error("File system error {0:?}: {1}")]
99
    FileSystem(PathBuf, #[source] std::io::Error),
100
    #[error("Failed to create tokio runtime: {0}")]
101
    FailedToCreateTokioRuntime(#[source] std::io::Error),
102
    #[error("Reqwest error: {0}")]
103
    Reqwest(#[from] reqwest::Error),
104
    #[error(transparent)]
105
    ConfigCombineError(#[from] ConfigCombineError),
106
    #[error("Failed to serialize config to json: {0}")]
107
    SerializeConfigToJson(#[source] serde_json::Error),
108
    #[error("Missing config options to be overridden: {0}")]
109
    MissingConfigOverride(String),
110
    #[error("Failed to deserialize config from json: {0}")]
111
    DeserializeConfigFromJson(#[source] serde_json::Error),
×
112
}
113

114
#[derive(Error, Debug)]
×
115
pub enum CloudError {
116
    #[error("Connection failed. Error: {0:?}")]
117
    ConnectionToCloudServiceError(#[from] tonic::transport::Error),
118

119
    #[error("Cloud service returned error: {0:?}")]
120
    CloudServiceError(#[from] tonic::Status),
121

122
    #[error("GRPC request failed, error: {} (GRPC status {})", .0.message(), .0.code())]
123
    GRPCCallError(#[source] tonic::Status),
124

125
    #[error(transparent)]
126
    CloudCredentialError(#[from] CloudCredentialError),
127

128
    #[error("Reqwest error: {0}")]
129
    Reqwest(#[from] reqwest::Error),
130

131
    #[error("Response header {DOZER_SERVER_NAME_HEADER} is missing")]
132
    MissingResponseHeader,
133

134
    #[error(transparent)]
135
    CloudContextError(#[from] CloudContextError),
136

137
    #[error(transparent)]
138
    ConfigCombineError(#[from] ConfigCombineError),
×
139
}
140

141
#[derive(Debug, Error)]
×
142
pub enum ConfigCombineError {
143
    #[error("Failed to parse yaml file {0}: {1}")]
144
    ParseYaml(String, #[source] serde_yaml::Error),
145

146
    #[error("Cannot merge yaml value {from:?} to {to:?}")]
147
    CannotMerge {
148
        from: serde_yaml::Value,
149
        to: serde_yaml::Value,
150
    },
151

152
    #[error("Failed to parse config: {0}")]
153
    ParseConfig(#[source] serde_yaml::Error),
154

155
    #[error("Cannot read configuration: {0:?}")]
156
    CannotReadConfig(PathBuf, #[source] std::io::Error),
157

158
    #[error("Wrong pattern of config files read glob: {0}")]
159
    WrongPatternOfConfigFilesGlob(#[from] PatternError),
160

161
    #[error("Cannot read file: {0}")]
162
    CannotReadFile(#[from] GlobError),
163

164
    #[error("Cannot serialize config to string: {0}")]
165
    CannotSerializeToString(#[source] serde_yaml::Error),
×
166

167
    #[error("SQL is not a string type")]
168
    SqlIsNotStringType,
×
169
}
170

171
#[derive(Debug, Error)]
×
172
pub enum BuildError {
173
    #[error("Got mismatching primary key for `{endpoint_name}`. Expected: `{expected:?}`, got: `{actual:?}`")]
174
    MismatchPrimaryKey {
175
        endpoint_name: String,
176
        expected: Vec<String>,
177
        actual: Vec<String>,
178
    },
179
    #[error("Field not found at position {0}")]
180
    FieldNotFound(String),
181
    #[error("File system error {0:?}: {1}")]
182
    FileSystem(PathBuf, std::io::Error),
183
    #[error("Cannot load existing schema: {0}")]
184
    CannotLoadExistingSchema(#[source] SchemaError),
185
    #[error("Cannot write schema: {0}")]
186
    CannotWriteSchema(#[source] SchemaError),
187
    #[error("Failed to generate proto files: {0:?}")]
×
188
    FailedToGenerateProtoFiles(#[from] GenerationError),
189
    #[error("Storage error: {0}")]
190
    Storage(#[from] storage::Error),
×
191
}
192

193
#[derive(Debug, Error)]
×
194
pub enum CloudLoginError {
195
    #[error("Tonic error: {0}")]
196
    TonicError(#[from] tonic::Status),
197

198
    #[error("Transport error: {0}")]
199
    Transport(#[from] tonic::transport::Error),
200

201
    #[error("HttpRequest error: {0}")]
202
    HttpRequestError(#[from] reqwest::Error),
203

204
    #[error(transparent)]
205
    SerializationError(#[from] dozer_types::serde_json::Error),
206

207
    #[error("Failed to read input: {0}")]
×
208
    InputError(#[from] std::io::Error),
209

210
    #[error(transparent)]
211
    CloudCredentialError(#[from] CloudCredentialError),
212

213
    #[error("Organisation not found")]
214
    OrganisationNotFound,
×
215
}
216

217
#[derive(Debug, Error)]
×
218
pub enum CloudCredentialError {
219
    #[error(transparent)]
220
    SerializationError(#[from] dozer_types::serde_yaml::Error),
221

222
    #[error(transparent)]
223
    JsonSerializationError(#[from] dozer_types::serde_json::Error),
224
    #[error("Failed to create home directory: {0}")]
225
    FailedToCreateDirectory(#[from] std::io::Error),
226

×
227
    #[error("HttpRequest error: {0}")]
228
    HttpRequestError(#[from] reqwest::Error),
229

230
    #[error("Missing credentials.yaml file - Please try to login again")]
231
    MissingCredentialFile,
232
    #[error("There's no profile with given name - Please try to login again")]
233
    MissingProfile,
×
234
}
235

236
#[derive(Debug, Error)]
×
237
pub enum CloudContextError {
238
    #[error("Failed to create access directory: {0}")]
239
    FailedToAccessDirectory(#[from] std::io::Error),
240

241
    #[error("Failed to get current directory path")]
242
    FailedToGetDirectoryPath,
243

244
    #[error("App id not found in configuration. You need to run \"deploy\" or \"set-app\" first")]
245
    AppIdNotFound,
246
}
STATUS · Troubleshooting · Open an Issue · Sales · Support · CAREERS · ENTERPRISE · START FREE · SCHEDULE DEMO
ANNOUNCEMENTS · TWITTER · TOS & SLA · Supported CI Services · What's a CI service? · Automated Testing

© 2026 Coveralls, Inc