From 50eb39eb5eb7552ceb3884c600e10801d07b1337 Mon Sep 17 00:00:00 2001 From: Ankush Menat Date: Tue, 26 Oct 2021 22:17:00 +0530 Subject: [PATCH] fix(dx): error message for missing system deps --- frappe/utils/weasyprint.py | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) diff --git a/frappe/utils/weasyprint.py b/frappe/utils/weasyprint.py index 006bab2dd0..44770f7412 100644 --- a/frappe/utils/weasyprint.py +++ b/frappe/utils/weasyprint.py @@ -1,8 +1,20 @@ # Copyright (c) 2021, Frappe Technologies Pvt. Ltd. and Contributors # MIT License. See LICENSE +import click + import frappe -from weasyprint import HTML, CSS + +try: + from weasyprint import HTML, CSS +except OSError: + click.secho( + "\n".join(["WeasyPrint depdends on additional system dependencies.", + "Follow instructions specific to your operating system:", + "https://doc.courtbouillon.org/weasyprint/stable/first_steps.html"]), + fg="yellow" + ) + raise @frappe.whitelist()