File tree Expand file tree Collapse file tree 2 files changed +3
-1
lines changed Expand file tree Collapse file tree 2 files changed +3
-1
lines changed Original file line number Diff line number Diff line change @@ -11,7 +11,7 @@ use super::outage::Severity;
1111
1212pub fn draw_checks ( checks : & [ Check ] , file : impl AsRef < Path > ) -> Result < ( ) , AnalysisError > {
1313 if checks. is_empty ( ) {
14- panic ! ( "need at least one check to draw the diagram" ) ;
14+ return Err ( AnalysisError :: NoChecksToAnalyze ) ;
1515 }
1616 let outfile: & Path = file. as_ref ( ) ;
1717 let mut data: Vec < ( DateTime < Local > , Severity ) > = Vec :: new ( ) ;
Original file line number Diff line number Diff line change @@ -195,4 +195,6 @@ pub enum AnalysisError {
195195 GraphDraw {
196196 reason : String , // plotters error type use generics, and that's just a pain
197197 } ,
198+ #[ error( "analysis was requested, but an empty list of checks was given" ) ]
199+ NoChecksToAnalyze ,
198200}
You can’t perform that action at this time.
0 commit comments