From f7f2839e657c2dcf94890bb08fa14783660b0eba Mon Sep 17 00:00:00 2001 From: Kai Chappell Date: Thu, 29 Jan 2026 17:56:29 +0000 Subject: [PATCH] Add reporting exception classes --- src/py_dvt_ate/reporting/exceptions.py | 41 ++++++++++++++++++++++++++ 1 file changed, 41 insertions(+) create mode 100644 src/py_dvt_ate/reporting/exceptions.py diff --git a/src/py_dvt_ate/reporting/exceptions.py b/src/py_dvt_ate/reporting/exceptions.py new file mode 100644 index 0000000..f50afa2 --- /dev/null +++ b/src/py_dvt_ate/reporting/exceptions.py @@ -0,0 +1,41 @@ +"""Exception classes for the reporting module. + +This module defines a hierarchy of exceptions for report generation errors, +enabling specific error handling for different failure modes. +""" + + +class ReportingError(Exception): + """Base exception for all reporting-related errors.""" + + +class ReportGenerationError(ReportingError): + """Raised when report generation fails. + + This is the general error for failures during the report generation + process that don't fit into more specific categories. + """ + + +class TemplateRenderError(ReportingError): + """Raised when HTML template rendering fails. + + This typically indicates a problem with the Jinja2 template or + the data being passed to it. + """ + + +class PDFConversionError(ReportingError): + """Raised when HTML to PDF conversion fails. + + This typically indicates a problem with WeasyPrint or the generated + HTML/CSS being incompatible with PDF rendering. + """ + + +class ChartGenerationError(ReportingError): + """Raised when chart generation fails. + + This typically indicates a problem with matplotlib or the measurement + data being charted. + """