Add reporting exception classes
This commit is contained in:
41
src/py_dvt_ate/reporting/exceptions.py
Normal file
41
src/py_dvt_ate/reporting/exceptions.py
Normal file
@@ -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.
|
||||||
|
"""
|
||||||
Reference in New Issue
Block a user