| ... | @@ -1513,7 +1513,19 @@ fn unzip( | ... | @@ -1513,7 +1513,19 @@ fn unzip( |
| 1513 | .read = true, | 1513 | .read = true, |
| 1514 | }) catch |err| switch (err) { | 1514 | }) catch |err| switch (err) { |
| 1515 | error.PathAlreadyExists => continue, | 1515 | error.PathAlreadyExists => continue, |
| 1516 | error.Canceled => return error.Canceled, | 1516 | error.FileNotFound => { |
| | 1517 | cache_root.handle.createDir(io, prefix, .default_dir) catch |dir_err| switch (dir_err) { |
| | 1518 | error.Canceled => |e| return e, |
| | 1519 | // error.PathAlreadyExists is considered a failure here because |
| | 1520 | // it implies that the prefix is not a directory. |
| | 1521 | else => |e| return f.fail( |
| | 1522 | f.location_tok, |
| | 1523 | try eb.printString("failed to create temporary directory: {t}", .{e}), |
| | 1524 | ), |
| | 1525 | }; |
| | 1526 | continue; |
| | 1527 | }, |
| | 1528 | error.Canceled => |e| return e, |
| 1517 | else => |e| return f.fail( | 1529 | else => |e| return f.fail( |
| 1518 | f.location_tok, | 1530 | f.location_tok, |
| 1519 | try eb.printString("failed to create temporary zip file: {t}", .{e}), | 1531 | try eb.printString("failed to create temporary zip file: {t}", .{e}), |
| ... | @@ -1526,7 +1538,7 @@ fn unzip( | ... | @@ -1526,7 +1538,7 @@ fn unzip( |
| 1526 | var zip_file_writer = zip_file.writer(io, &zip_file_buffer); | 1538 | var zip_file_writer = zip_file.writer(io, &zip_file_buffer); |
| 1527 | | 1539 | |
| 1528 | _ = reader.streamRemaining(&zip_file_writer.interface) catch |err| switch (err) { | 1540 | _ = reader.streamRemaining(&zip_file_writer.interface) catch |err| switch (err) { |
| 1529 | error.ReadFailed => return error.ReadFailed, | 1541 | error.ReadFailed => |e| return e, |
| 1530 | error.WriteFailed => return f.fail( | 1542 | error.WriteFailed => return f.fail( |
| 1531 | f.location_tok, | 1543 | f.location_tok, |
| 1532 | try eb.printString("failed writing temporary zip file: {t}", .{err}), | 1544 | try eb.printString("failed writing temporary zip file: {t}", .{err}), |