forked from matrix-org/rust-synapse-compress-state
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Make the script not write to db on invalid state.
- Loading branch information
Showing
2 changed files
with
36 additions
and
19 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,17 +1,19 @@ | ||
use crate::StateMap; | ||
use string_cache::{Atom, EmptyStaticAtomSet}; | ||
use thiserror::Error; | ||
|
||
#[derive(Error, Debug)] | ||
pub enum StateCompressorError { | ||
#[error("Missing state_goup: {}", .0)] | ||
#[error("Missing state_goup: {0}")] | ||
MissingStateGroup(i64), | ||
#[error("Missing prev_state_group: {}", .0)] | ||
#[error("Missing prev_state_group: {0}")] | ||
MissingPrevStateGroup(i64), | ||
#[error("States for group {} do not match. Expected {:#?}, found {:#?}", .0, .1, .2)] | ||
#[error("States for group {0} do not match. Expected {1:#?}, found {2:#?}")] | ||
StateMissmatchedForGroup( | ||
i64, | ||
Box<StateMap<Atom<EmptyStaticAtomSet>>>, | ||
Box<StateMap<Atom<EmptyStaticAtomSet>>>, | ||
), | ||
// This recursion is totally safe as we never have more than 2 levels of recursion | ||
#[error("expected state to match: {0}")] | ||
ExpectedStateMismatched(Box<StateCompressorError>), | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters