ECSError Display implementation prints double messages and unwraps on write failure #671
Labels
No labels
Context: Bug
Context: Enhancements
Platform: Android
Platform: Linux
Platform: Web
Platform: Windows
Platform: iOS
Platform: macOS
Target: CI
Target: CLI
Target: Dependency
Target: Engine
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set
Reference
SakulFlee/Orbital#671
Loading…
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Severity: 🟡 Medium
File:
Crates/ecs/src/error.rs:11-22Bug #1 — Double-printed error messages:
The
Displayimplementation prints the formatted message AND then falls through towriteln!(f, "{self:?}")which prints the Debug representation. Every error message is printed twice with different formatting.Bug #2 — Inconsistent error handling:
The
InvalidEntitybranch uses.unwrap()on thewriteln!()result, which will panic if the formatter encounters an error (e.g., broken pipe). TheComponentStoreNotExistingbranch correctly useslet _ =.Fixes:
writeln!(f, "{self:?}")or put it in anelse.let _ =consistently instead of.unwrap().@SakulFlee