diff --git a/components/templates/src/global_fns/load_data.rs b/components/templates/src/global_fns/load_data.rs index 8aa542da..7432a6c0 100644 --- a/components/templates/src/global_fns/load_data.rs +++ b/components/templates/src/global_fns/load_data.rs @@ -210,11 +210,10 @@ impl TeraFn for LoadData { .send() .and_then(|res| res.error_for_status()) .map_err(|e| { - format!( - "Failed to request {}: {}", - url, - e.status().expect("response status") - ) + match e.status() { + Some(status) => format!("Failed to request {}: {}", url, status), + None => format!("Could not get response status for url: {}", url), + } })?; response .text()