CacheErrorReason

public enum CacheErrorReason

Represents the error reason during Kingfisher caching system.

  • fileEnumeratorCreationFailed: Cannot create a file enumerator for a certain disk URL. Code 3001.
  • invalidFileEnumeratorContent: Cannot get correct file contents from a file enumerator. Code 3002.
  • invalidURLResource: The file at target URL exists, but its URL resource is unavailable. Code 3003.
  • cannotLoadDataFromDisk: The file at target URL exists, but the data cannot be loaded from it. Code 3004.
  • cannotCreateDirectory: Cannot create a folder at a given path. Code 3005.
  • imageNotExisting: The requested image does not exist in cache. Code 3006.
  • cannotConvertToData: Cannot convert an object to data for storing. Code 3007.
  • cannotSerializeImage: Cannot serialize an image to data for storing. Code 3008.
  • cannotCreateCacheFile: Cannot create the cache file at a certain fileURL under a key. Code 3009.
  • cannotSetCacheFileAttribute: Cannot set file attributes to a cached file. Code 3010.
  • Cannot create a file enumerator for a certain disk URL. Code 3001.

    • url: The target disk URL from which the file enumerator should be created.

    Declaration

    Swift

    case fileEnumeratorCreationFailed(url: URL)
  • Cannot get correct file contents from a file enumerator. Code 3002.

    • url: The target disk URL from which the content of a file enumerator should be got.

    Declaration

    Swift

    case invalidFileEnumeratorContent(url: URL)
  • The file at target URL exists, but its URL resource is unavailable. Code 3003.

    • error: The underlying error thrown by file manager.
    • key: The key used to getting the resource from cache.
    • url: The disk URL where the target cached file exists.

    Declaration

    Swift

    case invalidURLResource(error: Error, key: String, url: URL)
  • The file at target URL exists, but the data cannot be loaded from it. Code 3004.

    • url: The disk URL where the target cached file exists.
    • error: The underlying error which describes why this error happens.

    Declaration

    Swift

    case cannotLoadDataFromDisk(url: URL, error: Error)
  • Cannot create a folder at a given path. Code 3005.

    • path: The disk path where the directory creating operation fails.
    • error: The underlying error which describes why this error happens.

    Declaration

    Swift

    case cannotCreateDirectory(path: String, error: Error)
  • The requested image does not exist in cache. Code 3006.

    • key: Key of the requested image in cache.

    Declaration

    Swift

    case imageNotExisting(key: String)
  • Cannot convert an object to data for storing. Code 3007.

    • object: The object which needs be convert to data.

    Declaration

    Swift

    case cannotConvertToData(object: Any, error: Error)
  • Cannot serialize an image to data for storing. Code 3008.

    • image: The input image needs to be serialized to cache.
    • original: The original image data, if exists.
    • serializer: The CacheSerializer used for the image serializing.

    Declaration

    Swift

    case cannotSerializeImage(image: KFCrossPlatformImage?, original: Data?, serializer: CacheSerializer)
  • Cannot create the cache file at a certain fileURL under a key. Code 3009.

    • fileURL: The url where the cache file should be created.
    • key: The cache key used for the cache. When caching a file through KingfisherManager and Kingfisher’s extension method, it is the resolved cache key based on your input Source and the image processors.
    • data: The data to be cached.
    • error: The underlying error originally thrown by Foundation when writing the data to the disk file at fileURL.

    Declaration

    Swift

    case cannotCreateCacheFile(fileURL: URL, key: String, data: Data, error: Error)
  • Cannot set file attributes to a cached file. Code 3010.

    • filePath: The path of target cache file.
    • attributes: The file attribute to be set to the target file.
    • error: The underlying error originally thrown by Foundation when setting the attributes to the disk file at filePath.

    Declaration

    Swift

    case cannotSetCacheFileAttribute(filePath: String, attributes: [FileAttributeKey : Any], error: Error)