Error handling refactor and sanitizing #4

Closed
delandtj wants to merge 0 commits from sanitizing into main
Owner

Summary

  • Cleanup and modernize codebase: fix build issues, remove bollard dependency, rename docker→container
  • Refactor error handling with unified error type for better debugging and maintainability

Changes

Build & Dependencies Cleanup

  • Fix Rust 2024 never type fallback warning
  • Remove bollard, futures-util, tokio-async-drop dependencies
  • Replace Docker API with podman CLI for container-to-flist conversion
  • Rename docker module to container (DockerImageToFlist → ContainerImageToFlist)
  • Fix 33 clippy warnings, remove dead code
  • Add credential support for private registries via podman --creds

Unified Error Handling

  • Add src/error.rs with centralized Error type replacing scattered error enums
  • Add error classification methods: is_transient(), is_fatal(), to_errno()
  • Remove catch-all Anyhow variants that defeated type safety
  • Remove process::exit(1) from library code
  • Improve error messages:
    • MultipleStoreErrors now shows actual error details, not just count
    • S3 XML errors parsed to human-readable format (e.g., "AccessDenied: Forbidden: No such key")

Test plan

  • cargo clippy passes with no warnings
  • cargo test - all 22 tests pass
  • Manual test: mount flist and verify improved error messages
Summary - Cleanup and modernize codebase: fix build issues, remove bollard dependency, rename docker→container - Refactor error handling with unified error type for better debugging and maintainability Changes Build & Dependencies Cleanup - Fix Rust 2024 never type fallback warning - Remove bollard, futures-util, tokio-async-drop dependencies - Replace Docker API with podman CLI for container-to-flist conversion - Rename docker module to container (DockerImageToFlist → ContainerImageToFlist) - Fix 33 clippy warnings, remove dead code - Add credential support for private registries via podman --creds Unified Error Handling - Add src/error.rs with centralized Error type replacing scattered error enums - Add error classification methods: is_transient(), is_fatal(), to_errno() - Remove catch-all Anyhow variants that defeated type safety - Remove process::exit(1) from library code - Improve error messages: - MultipleStoreErrors now shows actual error details, not just count - S3 XML errors parsed to human-readable format (e.g., "AccessDenied: Forbidden: No such key") Test plan - cargo clippy passes with no warnings - cargo test - all 22 tests pass - Manual test: mount flist and verify improved error messages
- Fix Rust 2024 never type fallback in zdb.rs
- Remove bollard, futures-util, tokio-async-drop dependencies
- Replace Docker API with podman CLI for container-to-flist conversion
- Rename docker module to container (DockerImageToFlist -> ContainerImageToFlist)
- Fix 33 clippy warnings across codebase
- Remove dead code (PARALLEL_DOWNLOAD, ParallelCopyVisitor, unused test helpers)
- Add credential support for private registries via podman --creds
Introduces a centralized error handling architecture that replaces
scattered error types with a single, well-structured Error enum.

Key changes:
- Add src/error.rs with unified Error type and classification methods
  (is_transient, is_fatal, to_errno for FUSE compatibility)
- Remove fungi::meta::Error and store::Error enums
- Eliminate catch-all Anyhow variants that defeated type safety
- Remove process::exit(1) from library code (pack.rs)
- Replace anyhow::Context usage with explicit error mapping

Error reporting improvements:
- MultipleStoreErrors now shows actual error details, not just count
- S3 XML error responses are parsed to show Code/Message/Resource
  instead of raw XML (e.g., "AccessDenied: Forbidden: No such key")

All error variants are explicit with proper source chains for debugging.
Includes ADR document explaining the design decisions.
Author
Owner

@rawdaGastan
can you fix the src/store/zdb.rs conflict ? (anyway, I guess with the advent of herodb, the zdb.rs is dead in the water)

@rawdaGastan can you fix the src/store/zdb.rs conflict ? (anyway, I guess with the advent of herodb, the zdb.rs is dead in the water)
Proposes splitting monolithic myfs crate into workspace with:
- myfs-core: shared library (error, fungi, store, cache)
- myfs-server: HTTP server + admin tools (serve, token, track, website-publish)
- myfstool: advanced operations (container, clone, merge, sync)
- myfs: core flist operations (mount, config, pack, unpack, upload, download, exists, flist inspect)

Includes detailed implementation phases, file movement tables,
dependency graph, and command mapping.
Proposes fixing the catch-all error handler that converts all FUSE
errors to ENOENT. Instead, use the unified error type's to_errno()
method to map errors appropriately:

- BlockNotFound → ENOENT (file doesn't exist)
- StoreUnavailable → EAGAIN (retry later)
- Encryption/IO errors → EIO (I/O error)

This allows applications to distinguish transient errors (and retry)
from permanent ones.
Owner

merged on main

merged on main
thabeta closed this pull request 2026-01-07 10:02:40 +00:00

Pull request closed

Sign in to join this conversation.
No reviewers
No labels
No milestone
No project
No assignees
2 participants
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
geomind_code/my_fs!4
No description provided.