@@ -29,35 +29,13 @@ pub(crate) fn failure_reason(err: &Error) -> FailureReason {
29
29
| CommandError :: SandboxContainerCreate ( _)
30
30
| CommandError :: WorkspaceNotMountedCorrectly
31
31
| CommandError :: InvalidDockerInspectOutput ( _) => FailureReason :: Docker ,
32
- CommandError :: IO ( io) => {
33
- match io. kind ( ) {
34
- ErrorKind :: OutOfMemory => FailureReason :: OOM ,
35
- _ => {
36
- // FIXME use ErrorKind once #![feature(io_error_more)] is stable <https://github.com/rust-lang/rust/issues/86442>
37
- #[ cfg( target_os = "linux" ) ]
38
- match io. raw_os_error ( ) {
39
- // <https://mariadb.com/kb/en/operating-system-error-codes/#linux-error-codes>
40
- | Some ( 28 ) /* ErrorKind::StorageFull */
41
- | Some ( 122 ) /* ErrorKind::FilesystemQuotaExceeded */
42
- | Some ( 31 ) /* TooManyLinks */ => {
43
- return FailureReason :: NoSpace
44
- }
45
- _ => FailureReason :: Unknown
46
- }
47
-
48
- #[ cfg( target_os = "windows" ) ]
49
- match io. raw_os_error ( ) {
50
- // <https://learn.microsoft.com/en-us/windows/win32/debug/system-error-codes>
51
- | Some ( 39 |112 ) /* ErrorKind::StorageFull */
52
- | Some ( 1295 ) /* ErrorKind::FilesystemQuotaExceeded */
53
- | Some ( 1142 ) /* TooManyLinks */ => {
54
- return FailureReason :: NoSpace
55
- }
56
- _ => FailureReason :: Unknown
57
- }
58
- }
32
+ CommandError :: IO ( io) => match io. kind ( ) {
33
+ ErrorKind :: OutOfMemory => FailureReason :: OOM ,
34
+ ErrorKind :: StorageFull | ErrorKind :: QuotaExceeded | ErrorKind :: TooManyLinks => {
35
+ FailureReason :: NoSpace
59
36
}
60
- }
37
+ _ => FailureReason :: Unknown ,
38
+ } ,
61
39
CommandError :: ExecutionFailed { .. } | _ => FailureReason :: Unknown ,
62
40
}
63
41
} else {
0 commit comments