SDWebImageError.h 1.9 KB

123456789101112131415161718192021222324252627
  1. /*
  2. * This file is part of the SDWebImage package.
  3. * (c) Olivier Poitrey <rs@dailymotion.com>
  4. * (c) Jamie Pinkham
  5. *
  6. * For the full copyright and license information, please view the LICENSE
  7. * file that was distributed with this source code.
  8. */
  9. #import "SDWebImageCompat.h"
  10. FOUNDATION_EXPORT NSErrorDomain const _Nonnull SDWebImageErrorDomain;
  11. /// The HTTP status code for invalid download response (NSNumber *)
  12. FOUNDATION_EXPORT NSErrorUserInfoKey const _Nonnull SDWebImageErrorDownloadStatusCodeKey;
  13. /// SDWebImage error domain and codes
  14. typedef NS_ERROR_ENUM(SDWebImageErrorDomain, SDWebImageError) {
  15. SDWebImageErrorInvalidURL = 1000, // The URL is invalid, such as nil URL or corrupted URL
  16. SDWebImageErrorBadImageData = 1001, // The image data can not be decoded to image, or the image data is empty
  17. SDWebImageErrorCacheNotModified = 1002, // The remote location specify that the cached image is not modified, such as the HTTP response 304 code. It's useful for `SDWebImageRefreshCached`
  18. SDWebImageErrorBlackListed = 1003, // The URL is blacklisted because of unrecoverable failure marked by downloader (such as 404), you can use `.retryFailed` option to avoid this
  19. SDWebImageErrorInvalidDownloadOperation = 2000, // The image download operation is invalid, such as nil operation or unexpected error occur when operation initialized
  20. SDWebImageErrorInvalidDownloadStatusCode = 2001, // The image download response a invalid status code. You can check the status code in error's userInfo under `SDWebImageErrorDownloadStatusCodeKey`
  21. SDWebImageErrorCancelled = 2002, // The image loading operation is cancelled before finished, during either async disk cache query, or waiting before actual network request. For actual network request error, check `NSURLErrorDomain` error domain and code.
  22. SDWebImageErrorInvalidDownloadResponse = 2003, // When using response modifier, the modified download response is nil and marked as failed.
  23. };