From fc34f3fdbf8d1a0abe8f6ddc8e0f3bcb83710b8d Mon Sep 17 00:00:00 2001 From: Kim Alvefur Date: Tue, 6 Oct 2015 16:26:23 +0200 Subject: net.websocket.frames: Throw an error if no bit lib is found --- net/websocket/frames.lua | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'net') diff --git a/net/websocket/frames.lua b/net/websocket/frames.lua index 23f18437..2ff30736 100644 --- a/net/websocket/frames.lua +++ b/net/websocket/frames.lua @@ -10,8 +10,8 @@ local softreq = require "util.dependencies".softreq; local log = require "util.logger".init "websocket.frames"; local random_bytes = require "util.random".bytes; -local bit = softreq"bit" or softreq"bit32"; -if not bit then log("error", "No bit module found. Either LuaJIT 2, lua-bitop or Lua 5.2 is required"); end +local bit = assert(softreq"bit" or softreq"bit32", + "No bit module found. Either LuaJIT 2, lua-bitop or Lua 5.2 is required"); local band = bit.band; local bor = bit.bor; local bxor = bit.bxor; -- cgit v1.2.3