Skip to content

Commit ab08b7a

Browse files
committed
add better error message for non-configured api key
1 parent 6b0f5ef commit ab08b7a

File tree

3 files changed

+4
-5
lines changed

3 files changed

+4
-5
lines changed

src/cli/src/helpers.rs

+2-4
Original file line numberDiff line numberDiff line change
@@ -66,10 +66,8 @@ pub async fn check_remote_version_blocking(host: impl AsRef<str>) -> Result<(),
6666
).into()));
6767
}
6868
}
69-
Err(_) => {
70-
return Err(OxenError::basic_str(
71-
"Error: unable to verify remote version",
72-
));
69+
Err(err) => {
70+
return Err(err);
7371
}
7472
}
7573
Ok(())

src/lib/src/api/client.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -77,7 +77,7 @@ fn builder_for_host<S: AsRef<str>>(
7777
Err(err) => {
7878
log::debug!("remote::client::new_for_host error getting config: {}", err);
7979

80-
return Ok(builder);
80+
return Err(OxenError::must_supply_valid_api_key());
8181
}
8282
};
8383
if let Some(auth_token) = config.auth_token_for_host(host.as_ref()) {

src/lib/src/api/client/repositories.rs

+1
Original file line numberDiff line numberDiff line change
@@ -114,6 +114,7 @@ pub async fn get_by_remote(remote: &Remote) -> Result<Option<RemoteRepository>,
114114
let client = client::new_for_url(&url)?;
115115
match client.get(&url).send().await {
116116
Ok(res) => {
117+
log::debug!("get_by_remote status: {}", res.status());
117118
if 404 == res.status() {
118119
return Ok(None);
119120
}

0 commit comments

Comments
 (0)