Skip to content

refactor: add ChannelError helper to reduce map_err boilerplate #1989

@bug-ops

Description

@bug-ops

Epic: #1975

.map_err(|e| ChannelError::Other(e.to_string())) repeated 14+ times across channel implementations (telegram.rs, discord/mod.rs, slack/mod.rs, cli.rs).

Add helper method:

impl ChannelError {
    pub fn other(e: impl std::fmt::Display) -> Self { Self::Other(e.to_string()) }
}

Or implement From<Box<dyn Error>> for ChannelError.

Acceptance Criteria:

  • Helper method exists
  • All 14+ call sites use the helper
  • All channel tests pass

Complexity: Trivial | Effort: 30m
Ref: DRY-04

Metadata

Metadata

Assignees

No one assigned

    Labels

    architectureArchitecture improvements

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions