Skip to content

Commit

Permalink
Merge branch 'main' into feature/eng-1283-assess-whether-we-can-sugge…
Browse files Browse the repository at this point in the history
…st-project-restart-anywhere
  • Loading branch information
iulianbarbu committed Sep 15, 2023
2 parents 0c1c419 + a77ecb1 commit a9122bf
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 11 deletions.
4 changes: 3 additions & 1 deletion cargo-shuttle/src/client.rs
Expand Up @@ -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(
Expand Down
20 changes: 10 additions & 10 deletions cargo-shuttle/src/lib.rs
Expand Up @@ -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::{
Expand All @@ -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,
};
Expand Down Expand Up @@ -102,13 +102,13 @@ impl Shuttle {
args: ShuttleArgs,
provided_path_to_init: bool,
) -> Result<CommandOutcome> {
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
Expand Down Expand Up @@ -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}")
}
}
Expand Down

0 comments on commit a9122bf

Please sign in to comment.