Source code for thesis.core.exceptions
"""
Custom exceptions for the thesis framework.
This module defines exception classes for different types of errors
that can occur during pipeline processing.
"""
__all__ = [
"ThesisError",
"ConfigurationError",
"ProcessingError",
"ValidationError",
"RegistrationError",
"SegmentationError",
"TractographyError",
"PipelineError",
"FileIOError",
"DependencyError",
]
[docs]
class ThesisError(Exception):
"""Base exception for all thesis framework errors."""
pass
[docs]
class ConfigurationError(ThesisError):
"""Raised when configuration is invalid or missing.
Examples:
- Missing required configuration file
- Invalid configuration values
- Configuration validation failure
"""
pass
[docs]
class ValidationError(ThesisError):
"""Raised when input validation fails.
Examples:
- Invalid image dimensions
- Missing required files
- Invalid parameter values
"""
pass
[docs]
class ProcessingError(ThesisError):
"""Raised when processing operation fails.
Examples:
- Algorithm failure
- Computation error
- Unexpected processing result
"""
pass
[docs]
class RegistrationError(ProcessingError):
"""Raised when image registration fails."""
pass
[docs]
class SegmentationError(ProcessingError):
"""Raised when image segmentation fails."""
pass
[docs]
class TractographyError(ProcessingError):
"""Raised when tractography processing fails."""
pass
[docs]
class PipelineError(ProcessingError):
"""Raised when a pipeline step produces an invalid or unrecoverable result.
Examples:
- Warped ROI mask is entirely empty
- Pipeline invariant violated during execution
"""
pass
[docs]
class FileIOError(ThesisError):
"""Raised when I/O operation fails.
Examples:
- Unable to read file
- Unable to write file
- Corrupted data
"""
pass
[docs]
class DependencyError(ThesisError):
"""Raised when external dependency is missing or incompatible.
Examples:
- FSL not installed
- ANTs not found
- Incompatible library version
"""
pass