 
                 if not promise?
                   message = 'Received a record containing an unknown sequence number.'
-                  setImmediate => @emit 'error', new PubSubError("#{message}: #{rec}")
+                  setImmediate => @emit 'error', new errors.PubSubError("#{message}: #{rec}")
 
                   logger.error "#{message}: #{rec}"
                 else

        .catch (error) ->
          message = "Socket error while subscribing to channel:"
          logger.error message, error
          reject new error.PubSubError message, error 
        
      else
        message = "Could not subscribe to channel as the socket is currently disconnected."
        logger.warn message
        reject new error.PubSubError message, null

    .then (response) -> response.channels


        .catch (error) ->
          message = "Socket error while requesting client UUID:"
          logger.error message, error
          reject new errors.PubSubError message, error 
        
      else
        message = "Could not fetch the client UUID as the socket is currently disconnected."
        logger.warn message
        reject new errors.PubSubError message, null

    .then (response) -> response.uuid
    
