Improve the panic message for schedule build errors (#7860)
# Objective The `ScheduleBuildError` type has a `Display` implementation which beautifully formats the error. However, schedule build errors are currently reported using `unwrap()`, which uses the `Debug` implementation and makes the error message look unfished. ## Solution Use `unwrap_or_else` so we can customize the formatting of the error message.
This commit is contained in:
		
							parent
							
								
									002c9d8b7f
								
							
						
					
					
						commit
						4fd12d099d
					
				@ -245,7 +245,7 @@ impl Schedule {
 | 
			
		||||
    /// Runs all systems in this schedule on the `world`, using its current execution strategy.
 | 
			
		||||
    pub fn run(&mut self, world: &mut World) {
 | 
			
		||||
        world.check_change_ticks();
 | 
			
		||||
        self.initialize(world).unwrap();
 | 
			
		||||
        self.initialize(world).unwrap_or_else(|e| panic!("{e}"));
 | 
			
		||||
        self.executor.run(&mut self.executable, world);
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
		Loading…
	
		Reference in New Issue
	
	Block a user