diff --git a/cargo-shuttle/src/client.rs b/cargo-shuttle/src/client.rs index d3ef776314..61abc20198 100644 --- a/cargo-shuttle/src/client.rs +++ b/cargo-shuttle/src/client.rs @@ -156,7 +156,9 @@ impl Client { deployment_id ); - self.get(path).await + self.get(path) + .await + .context("Failed parsing logs. Is your cargo-shuttle outdated?") } pub async fn get_logs_ws( diff --git a/cargo-shuttle/src/lib.rs b/cargo-shuttle/src/lib.rs index ea048a55ae..450ba4a9f9 100644 --- a/cargo-shuttle/src/lib.rs +++ b/cargo-shuttle/src/lib.rs @@ -16,7 +16,6 @@ use std::str::FromStr; use shuttle_common::deployment::{DEPLOYER_END_MESSAGES_BAD, DEPLOYER_END_MESSAGES_GOOD}; use shuttle_common::models::deployment::CREATE_SERVICE_BODY_LIMIT; -use shuttle_common::LogItem; use shuttle_common::{ claims::{ClaimService, InjectPropagation}, models::{ @@ -27,6 +26,7 @@ use shuttle_common::{ }, }; use shuttle_common::{project::ProjectName, resource, ApiKey}; +use shuttle_common::{LogItem, API_URL_DEFAULT}; use shuttle_proto::runtime::{ self, runtime_client::RuntimeClient, LoadRequest, StartRequest, StopRequest, StorageManagerType, }; @@ -102,13 +102,13 @@ impl Shuttle { args: ShuttleArgs, provided_path_to_init: bool, ) -> Result { - trace!("running local client"); - - if args.api_url.as_ref().is_some_and(|s| s.ends_with('/')) { - println!( - "WARNING: API URL is probably incorrect. Ends with '/': {}", - args.api_url.clone().unwrap() - ); + if let Some(ref url) = args.api_url { + if url != API_URL_DEFAULT { + println!("INFO: Targetting non-standard API: {url}"); + } + if url.ends_with('/') { + eprintln!("WARNING: API URL is probably incorrect. Ends with '/': {url}"); + } } // All commands that need to know which project is being handled @@ -544,8 +544,8 @@ impl Shuttle { while let Some(Ok(msg)) = stream.next().await { if let tokio_tungstenite::tungstenite::Message::Text(line) = msg { - let log_item: shuttle_common::LogItem = - serde_json::from_str(&line).expect("to parse log line"); + let log_item: shuttle_common::LogItem = serde_json::from_str(&line) + .context("Failed parsing logs. Is your cargo-shuttle outdated?")?; println!("{log_item}") } }