Skip to main content

Module error

Module error 

Source
Expand description

Error types and result handling for the RPFM library.

This module defines RLibError, a comprehensive error type that covers all possible error conditions that can occur when working with Total War PackFiles and related files.

§Error Categories

The errors are organized into several categories:

  • Compression/Decompression: Errors related to file compression operations
  • Encoding/Decoding: Errors when reading or writing various file formats
  • File I/O: General file reading and writing errors
  • Schema/Definition: Errors related to missing or invalid schemas and definitions
  • Game-Specific: Errors specific to certain Total War games or features
  • External Libraries: Wrapped errors from third-party dependencies

§Usage

This module provides a custom Result type alias that uses RLibError as the default error type:

use rpfm_lib::error::Result;

fn do_something() -> Result<String> {
    // Returns Result<String, RLibError>
    Ok("success".to_string())
}

Enums§

RLibError
Comprehensive error type for all RPFM library operations.

Type Aliases§

Result
Custom Result type alias that uses RLibError as the default error type.