-
Notifications
You must be signed in to change notification settings - Fork 1.3k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #25 from dirkx/805d7bb81734adc8fd36c5a27c0f667fe7a…
…46580 Add error responses
- Loading branch information
Showing
2 changed files
with
65 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
// | ||
// HTTPErrorResponse.h | ||
// ScreenOnWall | ||
// | ||
// Created by Dirk-Willem van Gulik on 04-04-12. | ||
// Copyright (c) 2012 __MyCompanyName__. All rights reserved. | ||
// | ||
|
||
#import "HTTPResponse.h" | ||
|
||
@interface HTTPErrorResponse : NSObject <HTTPResponse> { | ||
NSInteger _status; | ||
} | ||
@property (assign) NSInteger _status; | ||
|
||
- (id)initWithErrorCode:(int)httpErrorCode; | ||
|
||
@end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,47 @@ | ||
// | ||
// HTTPErrorResponse.m | ||
// ScreenOnWall | ||
// | ||
// Created by Dirk-Willem van Gulik on 04-04-12. | ||
// Copyright (c) 2012 __MyCompanyName__. All rights reserved. | ||
// | ||
|
||
#import "HTTPErrorResponse.h" | ||
|
||
@implementation HTTPErrorResponse | ||
@synthesize _status = status; | ||
|
||
-(id)initWithErrorCode:(int)httpErrorCode | ||
{ | ||
if (!(self = [super init])) | ||
return nil; | ||
|
||
_status = httpErrorCode; | ||
|
||
return self; | ||
} | ||
|
||
- (UInt64) contentLength { | ||
return 0; | ||
} | ||
|
||
- (UInt64) offset { | ||
return 0; | ||
} | ||
|
||
- (void)setOffset:(UInt64)offset { | ||
; | ||
} | ||
|
||
- (NSData*) readDataOfLength:(NSUInteger)length { | ||
return nil; | ||
} | ||
|
||
- (BOOL) isDone { | ||
return YES; | ||
} | ||
|
||
- (NSInteger) status { | ||
return _status; | ||
} | ||
@end |