Skip to content

Commit

Permalink
Fix error messages
Browse files Browse the repository at this point in the history
  • Loading branch information
erikprice committed Jun 28, 2016
1 parent 62f6f76 commit 4d5f5f0
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions SocketRocket/SRWebSocket.m
Original file line number Diff line number Diff line change
Expand Up @@ -651,15 +651,15 @@ - (BOOL)sendData:(nullable NSData *)data error:(NSError **)error
- (BOOL)sendDataNoCopy:(nullable NSData *)data error:(NSError **)error
{
if (self.readyState != SR_OPEN) {
NSString *message = @"Invalid State: Cannot call `sendData:error:` until connection is open.";
NSString *message = @"Invalid State: Cannot call `sendDataNoCopy:error:` until connection is open.";
if (error) {
*error = SRErrorWithCodeDescription(2134, message);
}
SRDebugLog(message);
return NO;
}

NSAssert(self.readyState != SR_CONNECTING, @"Invalid State: Cannot call send: until connection is open");
NSAssert(self.readyState != SR_CONNECTING, @"Invalid State: Cannot call `sendDataNoCopy:error:` until connection is open");
dispatch_async(_workQueue, ^{
if (data) {
[self _sendFrameWithOpcode:SROpCodeBinaryFrame data:data];
Expand Down

0 comments on commit 4d5f5f0

Please sign in to comment.