diff --git a/server/src/handlers/page_handler.rs b/server/src/handlers/page_handler.rs index 51a4dadb4e..2646cc8467 100644 --- a/server/src/handlers/page_handler.rs +++ b/server/src/handlers/page_handler.rs @@ -309,7 +309,10 @@ pub async fn public_page( ..config.PUBLIC_DATASET.extra_params.unwrap_or_default() } }) - .unwrap(); + .map_err(|e| { + log::error!("Error rendering template: {:?}", e); + ServiceError::InternalServerError("Error rendering template".to_string()) + })?; Ok(HttpResponse::Ok().body(response_body)) } else { diff --git a/server/src/public/page.html b/server/src/public/page.html index bfdae6e359..ef27ff38f3 100644 --- a/server/src/public/page.html +++ b/server/src/public/page.html @@ -280,9 +280,10 @@
- {% if params.singleProductOptions.productName %} {% include "product.html" %} {% - endif %} {% if tabs|length > 0 %} {% include "tabs.html" %} {% else %} - {% include "search-component-code.html" %} {% endif %} + {% if params.singleProductOptions and params.singleProductOptions.productName %} {% include + "product.html" %} {% endif %} {% if tabs|length > 0 %} {% include + "tabs.html" %} {% else %} {% include "search-component-code.html" %} {% + endif %}
{% if logged_in %}