diff --git a/codegenerator/templates/rust_cli/impl_image_download.j2 b/codegenerator/templates/rust_cli/impl_image_download.j2 index 3ff836e..e7495c3 100644 --- a/codegenerator/templates/rust_cli/impl_image_download.j2 +++ b/codegenerator/templates/rust_cli/impl_image_download.j2 @@ -6,11 +6,11 @@ let image_id = image_data["id"] .as_str() - .expect("Image ID is a string") + .ok_or_else(|| eyre::eyre!("image ID must be a string"))? .to_string(); let image_name = image_data["name"] .as_str() - .expect("Image name is a string") + .ok_or_else(|| eyre::eyre!("image name must be a string"))? .to_string(); let ep = download::Request::builder()