refactor(core,storage): deduplicate code patterns (TODO-014)

Extract PttCapability event construction helper in events.rs.
Extract ensure_dir() helper in chanora_storage. Add TODO(refactor)
annotations for patterns requiring shared crate or API changes.
This commit is contained in:
Edison Jwa
2026-06-11 10:05:06 +09:00
parent 484522cbb6
commit 292617f8e8
7 changed files with 35 additions and 25 deletions
+4
View File
@@ -56,6 +56,10 @@ pub enum BridgeError {
/// The caller submitted a malformed command DTO.
#[error("invalid command: {0}")]
InvalidCommand(String),
// TODO(refactor): DnsFailed and ServerRejected mirror ProtocolError variants
// in chanora_protocol. These cannot be unified without changing the public FFI
// API (flutter_rust_bridge generates Dart types from these). Revisit only if
// the bridge error types are being reworked.
/// Hostname resolution failed. Distinct from `Connection` so the
/// UI can show a meaningful "Server not found" message.
#[error("dns: could not resolve '{host}': {reason}")]