//
//  SPRequestError.h
//  SharedParking
//
//  Created by gui_huan on 2018/3/26.
//  Copyright © 2018年 gui_huan. All rights reserved.
//

#import <Foundation/Foundation.h>

typedef NS_ENUM(NSInteger, SPErrorCode){
    SPErrorCode_Success                                     = 1,
//    SPErrorCode_OverDate                                 = -700,//接口过期
//    SPErrorCode_IlleggalToken                          = -800,//非法token
//    SPErrorCode_Other                                       = -900,//其他意外错误
//    SPErrorCode_IllegalRequest                         = -999,  //非法请求
    SPErrorCode_CustomError                           =-2000,//自定义
    SPErrorCode_ConnectionError                     =-3000, //连接错误，网络/超时等
//    SPErrorCode_LocalError                          =-4000//本地请求发起之前的错误
};
@interface SPRequestError : NSObject

/** 错误代码 **/
@property (nonatomic, assign) NSInteger code;
/** 错误原因 **/
@property (nonatomic, copy) NSString *msg;

+ (instancetype)errorWithReason:(NSString *)reason;
+ (instancetype)errorWithReason:(NSString *)reason errorCode:(NSInteger)errorCode;

@end
