Skip to content

Commit

Permalink
chore: include feature cloud
Browse files Browse the repository at this point in the history
  • Loading branch information
v3g42 committed Sep 20, 2023
1 parent d8c619b commit e392f4a
Show file tree
Hide file tree
Showing 4 changed files with 59 additions and 24 deletions.
65 changes: 49 additions & 16 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

5 changes: 3 additions & 2 deletions dozer-cli/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,8 @@ authors = ["getdozer/dozer-dev"]
name = "dozer"

[dependencies]
dozer-cloud-client = { path = "../../dozer-cloud-client" }

dozer-cloud-client = { git = "ssh://[email protected]/getdozer/dozer-cloud.git", rev = "refs/pull/628/head", optional = true }
dozer-api = { path = "../dozer-api" }
dozer-ingestion = { path = "../dozer-ingestion" }
dozer-core = { path = "../dozer-core" }
Expand Down Expand Up @@ -58,5 +59,5 @@ path = "src/main.rs"
snowflake = ["dozer-ingestion/snowflake"]
mongodb = ["dozer-ingestion/mongodb"]
onnx = ["dozer-sql/onnx"]
cloud = []
cloud = ["dozer-cloud-client"]
tokio-console = ["dozer-tracing/tokio-console"]
6 changes: 3 additions & 3 deletions dozer-cli/src/errors.rs
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@ use crate::live::LiveError;
use dozer_api::errors::{ApiInitError, AuthError, GenerationError, GrpcError};
use dozer_cache::dozer_log::storage;
use dozer_cache::errors::CacheError;
use dozer_cloud_client::errors::CloudError;
use dozer_core::errors::ExecutionError;
use dozer_ingestion::errors::ConnectorError;
use dozer_sql::errors::PipelineError;
Expand Down Expand Up @@ -58,8 +57,6 @@ pub enum OrchestrationError {
PipelineError(#[from] PipelineError),
#[error(transparent)]
CliError(#[from] CliError),
#[error(transparent)]
CloudError(#[from] CloudError),
#[error("table_name: {0:?} not found in any of the connections")]
SourceValidationError(String),
#[error("connection: {0:?} not found")]
Expand All @@ -78,6 +75,9 @@ pub enum OrchestrationError {
LockedOutdatedLockfile,
#[error("{LOCK_FILE} does not exist. `--locked` requires a lock file.")]
LockedNoLockFile,
#[cfg(feature = "cloud")]
#[error(transparent)]
CloudError(#[from] dozer_cloud_client::errors::CloudError),
}

#[derive(Error, Debug)]
Expand Down
7 changes: 4 additions & 3 deletions dozer-cli/src/main.rs
Original file line number Diff line number Diff line change
@@ -1,12 +1,10 @@
use ::dozer_cloud_client::run_cloud;
use clap::Parser;
use dozer_cli::cli::generate_config_repl;
use dozer_cli::cli::types::{Cli, Commands, ConnectorCommand, RunCommands, SecurityCommands};
use dozer_cli::cli::{init_dozer, list_sources, LOGO};
use dozer_cli::errors::{CliError, OrchestrationError};
use dozer_cli::simple::SimpleOrchestrator;
use dozer_cli::{live, set_ctrl_handler, set_panic_hook, shutdown};
use dozer_cloud_client::errors::display_cloud_error;

use dozer_tracing::LabelsAndProgress;
use dozer_types::models::telemetry::{TelemetryConfig, TelemetryMetricsConfig};
Expand Down Expand Up @@ -277,14 +275,17 @@ fn init_orchestrator(cli: &Cli) -> Result<SimpleOrchestrator, CliError> {
}
})
}

#[cfg(feature = "cloud")]
fn display_error(e: &OrchestrationError) {
if let OrchestrationError::CloudError(e) = &e {
display_cloud_error(e);
} else {
error!("{}", e);
}
}
fn display_error(e: &OrchestrationError) {
error!("{}", e);
}

struct Telemetry();

Expand Down

0 comments on commit e392f4a

Please sign in to comment.