         .catch (error) ->
           message = "Socket error while unsubscribing from channel:"
           logger.error message, error
-          reject new error.PubSubError message, error 
+          reject new errors.PubSubError message, error 
         
       else
         message = "Could not unsubscribe from channel as the socket is currently disconnected."
         logger.warn message
-        reject new error.PubSubError message, null
+        reject new errors.PubSubError message, null
 
     .then (response) -> response.channels
 

        .catch (error) ->
          message = "Socket error while unsubscribing from channel:"
          logger.error message, error
          reject new error.PubSubError message, error 
        
      else
        message = "Could not unsubscribe from 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
    
