Improve error handling in network module by suppressing Lua's error message when loading the socket module. This change enhances the user experience by preventing unnecessary error output while maintaining fallback functionality.

This commit is contained in:
Bastian (BaM)
2025-09-15 08:54:55 +02:00
parent e6dea9fc3f
commit 8b9c855912

View File

@@ -6,10 +6,10 @@ local utils = require("utils")
-- Try to load socket module, fallback to basic implementation for LuaJIT
local socket
local socket_available = true
-- Try to load socket module, ignore Lua's error message
local ok, err = pcall(function() socket = require("socket") end)
if not ok then
print("Warning: socket module not available, using fallback implementation")
print("Error:", err)
socket_available = false
-- Create a minimal socket fallback for LuaJIT
socket = {