More informative error message on missing stage (#1048)

More informative error message on missing state
This commit is contained in:
Alec Deason 2020-12-13 12:12:09 -08:00 committed by GitHub
parent 002e22fca0
commit e511cdbda7
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -158,7 +158,7 @@ impl Schedule {
) -> &mut Self {
let stage = self
.get_stage_mut::<T>(name)
.expect("stage does not exist or is the wrong type");
.unwrap_or_else(|| panic!("stage '{}' does not exist or is the wrong type", name));
func(stage);
self
}