Skip to content

Commit

Permalink
Merge pull request #25 from dirkx/805d7bb81734adc8fd36c5a27c0f667fe7a…
Browse files Browse the repository at this point in the history
…46580

Add error responses
  • Loading branch information
vronin committed Mar 8, 2013
2 parents 6740652 + 805d7bb commit a173a1a
Show file tree
Hide file tree
Showing 2 changed files with 65 additions and 0 deletions.
18 changes: 18 additions & 0 deletions Core/Responses/HTTPErrorResponse.h
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
47 changes: 47 additions & 0 deletions Core/Responses/HTTPErrorResponse.m
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

0 comments on commit a173a1a

Please sign in to comment.