Implement missing PrettyError impls (#3066)

This commit is contained in:
Mikko Lehtonen authored and GitHub committed 2022-10-05 18:43:52 -04:00
1 parent 50e2a5becf
commit 60fd2a32e9
5 files changed
+57 -4

No files matched your search

+12
View File
@@ -112,6 +112,18 @@ pub enum QueryError {
InvalidQuerySet(id::QuerySetId),
}
impl crate::error::PrettyError for QueryError {
fn fmt_pretty(&self, fmt: &mut crate::error::ErrorFormatter) {
fmt.error(self);
match *self {
Self::InvalidBuffer(id) => fmt.buffer_label(&id),
Self::InvalidQuerySet(id) => fmt.query_set_label(&id),
_ => {}
}
}
}
/// Error encountered while trying to use queries
#[derive(Clone, Debug, Error)]
pub enum QueryUseError {