Module changelog

Module changelog 

Source
Expand description

Changelog error types for package tools.

What: Defines error types specific to changelog generation, parsing, formatting, and version detection operations.

How: Uses thiserror for error definitions with rich context information including file paths, version strings, commit references, and parsing details. Implements AsRef<str> for string conversion.

Why: To provide clear, actionable error messages for changelog operations, enabling users to quickly identify and fix issues with changelog generation, conventional commit parsing, and version detection.

§Examples

use sublime_pkg_tools::error::{ChangelogError, ChangelogResult};
use std::path::PathBuf;

fn generate_changelog(path: &str) -> ChangelogResult<String> {
    if path.is_empty() {
        return Err(ChangelogError::InvalidPath {
            path: PathBuf::from(path),
            reason: "Changelog path cannot be empty".to_string(),
        });
    }
    Ok("changelog-content".to_string())
}

Enums§

ChangelogError
Errors that can occur during changelog operations.

Type Aliases§

ChangelogResult
Result type alias for changelog operations.