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;
11
11
12
12
pub fn draw_checks ( checks : & [ Check ] , file : impl AsRef < Path > ) -> Result < ( ) , AnalysisError > {
13
13
if checks. is_empty ( ) {
14
- panic ! ( "need at least one check to draw the diagram" ) ;
14
+ return Err ( AnalysisError :: NoChecksToAnalyze ) ;
15
15
}
16
16
let outfile: & Path = file. as_ref ( ) ;
17
17
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 {
195
195
GraphDraw {
196
196
reason : String , // plotters error type use generics, and that's just a pain
197
197
} ,
198
+ #[ error( "analysis was requested, but an empty list of checks was given" ) ]
199
+ NoChecksToAnalyze ,
198
200
}
You can’t perform that action at this time.
0 commit comments