Files
SWCompression/Sources/TAR/TarError.swift
T
Timofey Solomko 2a8fe7d37f [TAR] Remove an extra check in TarContainer functions for very small files
This situation is already covered by the check in TarParser, which results in ParsingResult.truncated. In addition, we repurposed TarError.tooSmallFileIsPassed for this cases (updated documentation).
2021-07-26 21:37:00 +03:00

22 lines
684 B
Swift

// Copyright (c) 2021 Timofey Solomko
// Licensed under MIT License
//
// See LICENSE for license information
import Foundation
/**
Represents an error which happened while processing a TAR container.
It may indicate that either container is damaged or it might not be TAR container at all.
*/
public enum TarError: Error {
/// Data is unexpectedly truncated.
case tooSmallFileIsPassed
/// Failed to process a *required* TAR header's field.
case wrongField
/// Computed checksum of a header doesn't match the value stored in container.
case wrongHeaderChecksum
/// Entry from PAX extended header is in incorrect format.
case wrongPaxHeaderEntry
}