Skip to content

Commit

Permalink
Merge pull request #125 from martius-lab/fkloss/push-uwtmwowyulso
Browse files Browse the repository at this point in the history
Print warning when report generation failed.
  • Loading branch information
luator authored Oct 28, 2024
2 parents 301302c + e6118bb commit 04ad904
Showing 1 changed file with 13 additions and 3 deletions.
16 changes: 13 additions & 3 deletions src/cluster_utils/server/report.py
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@
from . import data_analysis, distributions
from .latex_utils import LatexFile
from .optimizers import Optimizer
from .utils import log_and_print, shorten_string
from .utils import log_and_print, make_red, shorten_string


def init_plotting():
Expand Down Expand Up @@ -313,7 +313,12 @@ def filename_gen(base_path):
latex.produce_pdf(output_file)
log_and_print(logger, f"Report saved at {output_file}")
except Exception:
logging.warning("Could not generate PDF report", exc_info=True)
logging.warning("Failed to generate PDF report", exc_info=True)
print(
make_red(
"Warning: Failed to generate PDF report. See log for details."
)
)


def distribution_plots(
Expand Down Expand Up @@ -494,4 +499,9 @@ def filename_gen(base_path: str | os.PathLike) -> Iterator[str]:
latex.produce_pdf(output_file)
logger.info("Saved report to %s", output_file)
except Exception:
logger.warning("Could not generate PDF report", exc_info=True)
logger.warning("Failed to generate PDF report", exc_info=True)
print(
make_red(
"Warning: Failed to generate PDF report. See log for details."
)
)

0 comments on commit 04ad904

Please sign in to comment.