Skip to content

Commit 8e13e67

Browse files
committed
Remove accidentally duped channel error enum
1 parent f6874c2 commit 8e13e67

File tree

6 files changed

+7
-14
lines changed

6 files changed

+7
-14
lines changed

RMQClient/RMQAllocatedChannel.m

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -365,7 +365,7 @@ - (RMQQueue *)memoizedQueueDeclare:(NSString *)originalQueueName options:(RMQQue
365365

366366
if (self.queues[declaredQueueName]) {
367367
NSError *error = [NSError errorWithDomain:RMQErrorDomain
368-
code:RMQChannelErrorQueueNameCollision
368+
code:RMQErrorChannelQueueNameCollision
369369
userInfo:@{NSLocalizedDescriptionKey: @"Name collision when generating unique name."}];
370370
[self.delegate channel:self error:error];
371371
return nil;

RMQClient/RMQChannel.h

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -4,13 +4,6 @@
44
#import "RMQFrameHandler.h"
55
#import "RMQQueue.h"
66

7-
typedef NS_ENUM(NSInteger, RMQChannelError) {
8-
RMQChannelErrorUnallocated = 1,
9-
RMQChannelErrorWaitTimeout,
10-
RMQChannelErrorIncorrectSyncMethod,
11-
RMQChannelErrorQueueNameCollision,
12-
};
13-
147
@protocol RMQConnectionDelegate;
158

169
@protocol RMQChannel <NSObject, RMQFrameHandler>

RMQClient/RMQFramesetSemaphoreWaiter.m

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -31,13 +31,13 @@ - (RMQFramesetWaitResult *)waitOn:(Class)methodClass {
3131
if (dispatch_semaphore_wait(self.semaphore, self.syncTimeoutFromNow) != 0) {
3232
NSString *msg = [NSString stringWithFormat:@"Timed out waiting for %@.", methodClass];
3333
NSError *error = [NSError errorWithDomain:RMQErrorDomain
34-
code:RMQChannelErrorWaitTimeout
34+
code:RMQErrorChannelWaitTimeout
3535
userInfo:@{NSLocalizedDescriptionKey: msg}];
3636
result = [[RMQFramesetWaitResult alloc] initWithFrameset:nil error:error];
3737
} else if (![self.lastFrameset.method isKindOfClass:methodClass]) {
3838
NSString *msg = [NSString stringWithFormat:@"Expected %@, got %@.", methodClass, [self.lastFrameset.method class]];
3939
NSError *error = [NSError errorWithDomain:RMQErrorDomain
40-
code:RMQChannelErrorIncorrectSyncMethod
40+
code:RMQErrorChannelIncorrectSyncMethod
4141
userInfo:@{NSLocalizedDescriptionKey: msg}];
4242
result = [[RMQFramesetWaitResult alloc] initWithFrameset:self.lastFrameset error:error];
4343
} else {

RMQClient/RMQUnallocatedChannel.m

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ - (void)blockingWaitOn:(Class)method {}
2727
- (void)basicConsume:(NSString *)queueName
2828
options:(RMQBasicConsumeOptions)options
2929
consumer:(RMQConsumer)consumer {
30-
NSError *error = [NSError errorWithDomain:RMQErrorDomain code:RMQChannelErrorUnallocated userInfo:@{NSLocalizedDescriptionKey: @"Unallocated channel"}];
30+
NSError *error = [NSError errorWithDomain:RMQErrorDomain code:RMQErrorChannelUnallocated userInfo:@{NSLocalizedDescriptionKey: @"Unallocated channel"}];
3131
[self.delegate channel:self error:error];
3232
}
3333

RMQClientTests/RMQFramesetSemaphoreWaiterTest.swift

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ class RMQFramesetSemaphoreWaiterTest: XCTestCase {
77
let result = waiter.waitOn(RMQChannelOpenOk.self)
88

99
XCTAssertNil(result.frameset)
10-
XCTAssertEqual(RMQChannelError.WaitTimeout.rawValue, result.error.code)
10+
XCTAssertEqual(RMQError.ChannelWaitTimeout.rawValue, result.error.code)
1111
XCTAssertEqual("Timed out waiting for RMQChannelOpenOk.", result.error.localizedDescription)
1212
}
1313

@@ -21,7 +21,7 @@ class RMQFramesetSemaphoreWaiterTest: XCTestCase {
2121
let result = waiter.waitOn(RMQChannelOpenOk.self)
2222

2323
XCTAssertEqual(deliveredFrameset, result.frameset)
24-
XCTAssertEqual(RMQChannelError.IncorrectSyncMethod.rawValue, result.error.code)
24+
XCTAssertEqual(RMQError.ChannelIncorrectSyncMethod.rawValue, result.error.code)
2525
XCTAssertEqual("Expected RMQChannelOpenOk, got RMQBasicConsumeOk.", result.error.localizedDescription)
2626
}
2727

RMQClientTests/RMQUnallocatedChannelTest.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ class RMQUnallocatedChannelTest: XCTestCase {
77
let ch = RMQUnallocatedChannel()
88
ch.activateWithDelegate(delegate)
99
ch.basicConsume("foo", options: []) { (_) in }
10-
XCTAssertEqual(RMQChannelError.Unallocated.rawValue, delegate.lastChannelError?.code)
10+
XCTAssertEqual(RMQError.ChannelUnallocated.rawValue, delegate.lastChannelError?.code)
1111
XCTAssertEqual("Unallocated channel", delegate.lastChannelError!.localizedDescription)
1212
}
1313

0 commit comments

Comments
 (0)