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

getdozer / dozer / 4829321272

pending completion
4829321272

Pull #1515

github

GitHub
Merge b6d982211 into f2ab0e6ce
Pull Request #1515: feat: Run migration only when necessary

193 of 193 new or added lines in 11 files covered. (100.0%)

35565 of 45252 relevant lines covered (78.59%)

16462.37 hits per line

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

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

3
use std::path::PathBuf;
4

5
use dozer_api::errors::{ApiError, AuthError, GenerationError, GrpcError};
6
use dozer_cache::dozer_log::errors::SchemaError;
7
use dozer_cache::errors::CacheError;
8
use dozer_core::errors::ExecutionError;
9
use dozer_ingestion::errors::ConnectorError;
10
use dozer_sql::pipeline::errors::PipelineError;
11
use dozer_types::errors::internal::BoxedError;
12
use dozer_types::thiserror::Error;
13
use dozer_types::{serde_yaml, thiserror};
14

15
#[derive(Error, Debug)]
×
16
pub enum OrchestrationError {
17
    #[error("Failed to write config yaml: {0:?}")]
18
    FailedToWriteConfigYaml(#[source] serde_yaml::Error),
19
    #[error("File system error {0:?}: {1}")]
20
    FileSystem(PathBuf, std::io::Error),
21
    #[error("Failed to find migration for endpoint {0}")]
22
    NoMigrationFound(String),
23
    #[error("Failed to migrate: {0}")]
24
    MigrateFailed(#[from] MigrationError),
25
    #[error("Failed to generate token: {0}")]
26
    GenerateTokenFailed(#[source] AuthError),
27
    #[error("Missing api config or security input")]
28
    MissingSecurityConfig,
29
    #[error("Failed to deploy dozer application: {0:?}")]
30
    DeployFailed(#[from] DeployError),
31
    #[error("Failed to initialize api server: {0}")]
32
    ApiServerFailed(#[from] ApiError),
33
    #[error("Failed to initialize grpc server: {0}")]
34
    GrpcServerFailed(#[from] GrpcError),
35
    #[error("Failed to initialize internal server: {0}")]
36
    InternalServerFailed(#[source] tonic::transport::Error),
37
    #[error("{0}: Failed to initialize cache. Have you run `dozer migrate`?")]
38
    CacheInitFailed(#[source] CacheError),
39
    #[error("Failed to build cache from log")]
40
    CacheBuildFailed(#[source] CacheError),
41
    #[error("Internal thread panic: {0}")]
42
    JoinError(#[source] tokio::task::JoinError),
43
    #[error(transparent)]
44
    ExecutionError(#[from] ExecutionError),
45
    #[error(transparent)]
46
    ConnectorError(#[from] ConnectorError),
47
    #[error(transparent)]
48
    PipelineError(#[from] PipelineError),
49
    #[error(transparent)]
50
    CliError(#[from] CliError),
51
    #[error("Source validation failed")]
52
    SourceValidationError,
53
    #[error("Pipeline validation failed")]
54
    PipelineValidationError,
55
    #[error("Table name specified in endpoint not found: {0:?}")]
56
    EndpointTableNotFound(String),
57
    #[error("Duplicate table name found: {0:?}")]
58
    DuplicateTable(String),
59
    #[error("No endpoints initialized in the config provided")]
60
    EmptyEndpoints,
61
}
62

63
#[derive(Error, Debug)]
×
64
pub enum CliError {
65
    #[error("Can't find the configuration file at: {0:?}")]
66
    FailedToLoadFile(String),
67
    #[error("Unknown Command: {0:?}")]
68
    UnknownCommand(String),
69
    #[error("Failed to parse dozer config: {0:?}")]
70
    FailedToParseYaml(#[source] BoxedError),
71
    #[error("Failed to validate dozer config: {0:?}")]
72
    FailedToParseValidateYaml(#[source] BoxedError),
73
    #[error("Failed to read line: {0}")]
74
    ReadlineError(#[from] rustyline::error::ReadlineError),
75
    #[error("File system error {0:?}: {1}")]
76
    FileSystem(PathBuf, #[source] std::io::Error),
77
    #[error("Failed to create tokio runtime: {0}")]
78
    FailedToCreateTokioRuntime(#[source] std::io::Error),
79
    #[error("Reqwest error: {0}")]
80
    Reqwest(#[from] reqwest::Error),
81
}
82

83
#[derive(Error, Debug)]
×
84
pub enum DeployError {
85
    #[error("Cannot read configuration: {0}")]
86
    CannotReadConfig(PathBuf, #[source] std::io::Error),
87
    #[error("Transport error: {0}")]
88
    Transport(#[from] tonic::transport::Error),
89
    #[error("Server error: {0}")]
90
    Server(#[from] tonic::Status),
91
}
92

93
#[derive(Debug, Error)]
×
94
pub enum MigrationError {
95
    #[error("Got mismatching primary key for `{endpoint_name}`. Expected: `{expected:?}`, got: `{actual:?}`")]
96
    MismatchPrimaryKey {
97
        endpoint_name: String,
98
        expected: Vec<String>,
99
        actual: Vec<String>,
100
    },
101
    #[error("Field not found at position {0}")]
102
    FieldNotFound(String),
103
    #[error("File system error {0:?}: {1}")]
104
    FileSystem(PathBuf, std::io::Error),
105
    #[error("Cannot load existing schema: {0}")]
106
    CannotLoadExistingSchema(#[source] SchemaError),
107
    #[error("Cannot write schema: {0}")]
108
    CannotWriteSchema(#[source] SchemaError),
109
    #[error("Failed to generate proto files: {0:?}")]
110
    FailedToGenerateProtoFiles(#[from] GenerationError),
111
}
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

© 2025 Coveralls, Inc