@@ -18,6 +18,7 @@ use crate::{
18
18
targets:: Chip ,
19
19
} ;
20
20
21
+ /// All possible errors returned by espflash
21
22
#[ derive( Debug , Diagnostic , Error ) ]
22
23
#[ non_exhaustive]
23
24
pub enum Error {
@@ -172,6 +173,7 @@ impl From<SerialConfigError> for Error {
172
173
}
173
174
}
174
175
176
+ /// Connection-related errors
175
177
#[ derive( Debug , Diagnostic , Error ) ]
176
178
#[ non_exhaustive]
177
179
pub enum ConnectionError {
@@ -253,6 +255,7 @@ impl From<SlipError> for ConnectionError {
253
255
}
254
256
}
255
257
258
+ /// An executed command which has timed out
256
259
#[ derive( Clone , Debug , Default ) ]
257
260
pub struct TimedOutCommand {
258
261
command : Option < CommandType > ,
@@ -273,6 +276,7 @@ impl From<CommandType> for TimedOutCommand {
273
276
}
274
277
}
275
278
279
+ /// Errors originating from a device's ROM functionality
276
280
#[ derive( Clone , Copy , Debug , Default , Diagnostic , Error , FromRepr ) ]
277
281
#[ non_exhaustive]
278
282
#[ repr( u8 ) ]
@@ -357,6 +361,7 @@ impl From<u8> for RomErrorKind {
357
361
}
358
362
}
359
363
364
+ /// An error originating from a device's ROM functionality
360
365
#[ derive( Clone , Copy , Debug , Diagnostic , Error ) ]
361
366
#[ error( "Error while running {command} command" ) ]
362
367
#[ non_exhaustive]
@@ -372,6 +377,7 @@ impl RomError {
372
377
}
373
378
}
374
379
380
+ /// Missing partition error
375
381
#[ derive( Debug , Diagnostic , Error ) ]
376
382
#[ error( "Missing partition" ) ]
377
383
#[ diagnostic(
@@ -386,6 +392,7 @@ impl From<String> for MissingPartition {
386
392
}
387
393
}
388
394
395
+ /// Missing partition table error
389
396
#[ derive( Debug , Error , Diagnostic ) ]
390
397
#[ error( "No partition table could be found" ) ]
391
398
#[ diagnostic(
@@ -394,6 +401,7 @@ impl From<String> for MissingPartition {
394
401
) ]
395
402
pub struct MissingPartitionTable ;
396
403
404
+ /// Invalid ELF file error
397
405
#[ derive( Debug , Error ) ]
398
406
#[ error( "{0}" ) ]
399
407
pub struct ElfError ( & ' static str ) ;
@@ -404,7 +412,7 @@ impl From<&'static str> for ElfError {
404
412
}
405
413
}
406
414
407
- /// Uunsuported image format error
415
+ /// Unsupported image format error
408
416
#[ derive( Debug ) ]
409
417
pub struct UnsupportedImageFormatError {
410
418
format : ImageFormatKind ,
@@ -434,7 +442,7 @@ impl UnsupportedImageFormatError {
434
442
. join ( ", " )
435
443
}
436
444
437
- /// Update the context of the unsported image format error
445
+ /// Update the context of the unsupported image format error
438
446
pub fn with_context ( mut self , ctx : String ) -> Self {
439
447
self . context . replace ( ctx) ;
440
448
0 commit comments