Skip to main content

Module errors

Module errors 

Source
Expand description

Error types for the OCR pipeline.

Provides OCRError (the pipeline-wide error type), ProcessingStage (which stage an error occurred in), and helper constructors for building errors with context and chaining.

§Usage

use oar_ocr_core::core::errors::{OCRError, ProcessingStage};

// Create a processing error with context
let error = OCRError::tensor_operation(
    "Failed to reshape tensor for batch processing",
    std::io::Error::new(std::io::ErrorKind::InvalidData, "Invalid tensor shape")
);

// Create a configuration error
let config_error = OCRError::config_error("Missing required model path");

// Create a validation error with detailed context
let validation_error = OCRError::validation_error(
    "TextDetector",
    "input_size",
    "[640, 640]",
    "[320, 320]"
);

Structs§

OpaqueError
A simple, opaque error wrapper for cases where the original error type is not Send or doesn’t implement std::error::Error.

Enums§

ImageProcessError
Errors that can occur during image processing operations.
OCRError
Enum representing various errors that can occur in the OCR pipeline.
ProcessingStage
Enum representing different stages of processing in the OCR pipeline.

Type Aliases§

OcrResult
Convenient result alias for OCR operations.