Add `StringErrorPlaceholder` error variant
Allows some context to be passed in placeholder errors. Like
.exepect() instead of .unwrap() (GenericErrorPlaceholder).
Change-Id: I3d4027560b55a6b8879db62402a5f752e6c520c4
Reviewed-on: https://pigweed-review.googlesource.com/c/pigweed/qg/+/126255
Pigweed-Auto-Submit: Erik Gilling <konkers@google.com>
Commit-Queue: Auto-Submit <auto-submit@pigweed.google.com.iam.gserviceaccount.com>
Reviewed-by: Alexei Frolov <frolv@google.com>
diff --git a/qg/src/lib.rs b/qg/src/lib.rs
index 7788e57..7d945b1 100644
--- a/qg/src/lib.rs
+++ b/qg/src/lib.rs
@@ -63,6 +63,11 @@
// a real error handling model is figured out.
#[error("placeholder error, please bug the qg team")]
GenericErrorPlaceholder,
+
+ // TODO(frolv): This is a placeholder error returned by some functions until
+ // a real error handling model is figured out.
+ #[error("placeholder error with string, please bug the qg team: {0}")]
+ StringErrorPlaceholder(String),
}
impl Error {