File tree Expand file tree Collapse file tree 1 file changed +21
-2
lines changed
libparsec/crates/platform_device_loader/src Expand file tree Collapse file tree 1 file changed +21
-2
lines changed Original file line number Diff line number Diff line change @@ -12,12 +12,31 @@ use crate::{get_local_pending_dir, LOCAL_PENDING_EXT};
1212
1313#[ derive( Debug , thiserror:: Error ) ]
1414pub enum SavePkiLocalPendingError {
15- #[ error( transparent) ]
16- SaveContentError ( #[ from] SaveContentError ) ,
15+ #[ error( "No space available" ) ]
16+ NoSpaceAvailable ,
17+ #[ error( "invalid path" ) ]
18+ InvalidPath ,
1719 #[ error( transparent) ]
1820 Internal ( anyhow:: Error ) ,
1921}
2022
23+ impl From < SaveContentError > for SavePkiLocalPendingError {
24+ fn from ( value : SaveContentError ) -> Self {
25+ match value {
26+ SaveContentError :: NotAFile
27+ | SaveContentError :: InvalidParent
28+ | SaveContentError :: InvalidPath
29+ | SaveContentError :: ParentNotFound
30+ | SaveContentError :: CannotEdit => SavePkiLocalPendingError :: InvalidPath ,
31+
32+ SaveContentError :: StorageNotAvailable | SaveContentError :: NoSpaceLeft => {
33+ SavePkiLocalPendingError :: NoSpaceAvailable
34+ }
35+ SaveContentError :: Internal ( _) => SavePkiLocalPendingError :: Internal ( value. into ( ) ) ,
36+ }
37+ }
38+ }
39+
2140pub async fn save_pki_local_pending (
2241 local_pending : PKILocalPendingEnrollment ,
2342 local_file : PathBuf ,
You can’t perform that action at this time.
0 commit comments