SDWebImageError.h 1.4 KB

123456789101112131415161718192021222324
  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. SDWebImageErrorInvalidDownloadOperation = 2000, // The image download operation is invalid, such as nil operation or unexpected error occur when operation initialized
  19. SDWebImageErrorInvalidDownloadStatusCode = 2001, // The image downloda response a invalid status code. You can check the status code in error's userInfo under `SDWebImageErrorDownloadStatusCodeKey`
  20. };