File tree Expand file tree Collapse file tree 2 files changed +3
-4
lines changed
cvmassistants/quote-generator/src Expand file tree Collapse file tree 2 files changed +3
-4
lines changed Original file line number Diff line number Diff line change @@ -4,8 +4,8 @@ use std::array::TryFromSliceError;
44
55#[ derive( Error , Debug ) ]
66pub enum QuoteGeneratorError {
7- #[ error( "Invalid usage: expected exactly 1 argument (report data)" ) ]
8- InvalidUsage ,
7+ #[ error( "Invalid usage: expected exactly 1 argument (report data), received {actual} " ) ]
8+ InvalidUsage { actual : usize } ,
99
1010 #[ error( "Report data must be at most {max} bytes, got {actual} bytes" ) ]
1111 ReportDataTooLarge { max : usize , actual : usize } ,
Original file line number Diff line number Diff line change @@ -132,8 +132,7 @@ fn main() -> Result<(), QuoteGeneratorError> {
132132
133133 let args: Vec < String > = env:: args ( ) . collect ( ) ;
134134 if args. len ( ) != 2 {
135- error ! ( "Usage: {} <{}-byte-report-data>" , args[ 0 ] , REPORT_DATA_SIZE ) ;
136- process:: exit ( 1 ) ;
135+ return Err ( QuoteGeneratorError :: InvalidUsage { actual : args. len ( ) } ) ;
137136 }
138137
139138 let input = & args[ 1 ] ;
You can’t perform that action at this time.
0 commit comments