Skip to content

Commit 856fe64

Browse files
committed
chore(argo-workflows-openapi): improve error messages on failure to retrieve argo server schema
1 parent 4f5c4e9 commit 856fe64

File tree

1 file changed

+5
-4
lines changed

1 file changed

+5
-4
lines changed

backend/argo-workflows-openapi/build.rs

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -8,10 +8,11 @@ use std::{
88
use typify::{TypeSpace, TypeSpaceSettings};
99

1010
fn main() {
11-
let raw_schema = reqwest::blocking::get(env::var("ARGO_SERVER_SCHEMA_URL").unwrap())
12-
.unwrap()
13-
.text()
14-
.unwrap();
11+
let argo_server_schema_url =
12+
env::var("ARGO_SERVER_SCHEMA_URL").expect("ARGO_SERVER_SCHEMA_URL environment is not set.");
13+
let raw_schema = reqwest::blocking::get(&argo_server_schema_url)
14+
.and_then(|response| response.text())
15+
.expect(&format!("Failed to retrieve argo server schema from {argo_server_schema_url}. Is ARGO_SERVER_SCHEMA_URL environment variable set?"));
1516
let mut schema: RootSchema = serde_json::from_str(&raw_schema).unwrap();
1617
// The upstream argo workflow API schema does not match with its API response.
1718
// This is a temporary fix to match the API response.

0 commit comments

Comments
 (0)