ZYLNetworkTaskError.h 1.2 KB

12345678910111213141516171819202122232425262728293031323334
  1. //
  2. // ZYLNetworkTaskError.h
  3. // NetworkLayerBuild
  4. //
  5. // Created by 翟玉磊 on 2017/9/1.
  6. // Copyright © 2017年 翟玉磊. All rights reserved.
  7. //
  8. #ifndef ZYLNetworkTaskError_h
  9. #define ZYLNetworkTaskError_h
  10. #define REQUEST_SUCCESS 0
  11. typedef enum : NSInteger {
  12. ZYLNetworkTaskErrorAccountFailure = -2, //账号失效
  13. ZYLNetworkTaskErrorTimeout = 101,
  14. ZYLNetworkTaskErrorCannotConnectedToInternet = 102,
  15. ZYLNetworkTaskErrorCanceled = 103,
  16. ZYLNetworkTaskErrorDefault = 104,
  17. ZYLNetworkTaskErrorNoData = 105,
  18. ZYLNetworkTaskErrorNOMoreData = 106
  19. } ZYLNetworkTaskError;
  20. static ZYLNetworkError *ZYLError(NSString *domain, int code, NSString *codeStr) {
  21. return [ZYLNetworkError errorWithDomain:(domain ? domain : @"") code:code codeStr:codeStr userInfo:nil];
  22. }
  23. static NSString *ZYLAccountFailureErrorNotice = @"请先登录。";
  24. static NSString *ZYLNoDataErrorNotice = @"这里什么也没有。";
  25. static NSString *ZYLNetworkErrorNotice = @"当前网络差, 请检查网络设置。";
  26. static NSString *ZYLTimeoutErrorNotice = @"请求超时了。";
  27. static NSString *ZYLDefaultErrorNotice = @"请求失败了。";
  28. static NSString *ZYLNoMoreDataErrorNotice = @"~ 持续更新中。";
  29. #endif /* ZYLNetworkTaskError_h */