//
//  DOHTTPErrorFilter.h
//  DOCore
//
//  Created by Ben Dolman on 3/5/15.
//
//

#import <Foundation/Foundation.h>
#import <DOCore/DOHTTPResponseFilter.h>

/**
 * A filter that detects failed responses and returns an error in the DOHTTPErrorDomain
 * This filter doesn't look at the input object at all—only the response.
 */
@interface DOHTTPErrorFilter : NSObject <DOHTTPResponseFilter>

/**
 * A shared error filter with defaults success codes (200-299).
 */
+ (instancetype)defaultFilter;

@property (copy, readonly) NSIndexSet *successCodes;

/**
 * Initializes the filter with default success codes (200-299).
 */
- (instancetype)init;
- (instancetype)initWithSuccessCodes:(NSIndexSet *)indexSet NS_DESIGNATED_INITIALIZER;

@end
