mirror of
https://github.com/Refactorio/RedMew.git
synced 2024-12-12 10:04:40 +02:00
15 lines
357 B
Lua
15 lines
357 B
Lua
local require = require
|
|
local pcall = pcall
|
|
local find = string.find
|
|
|
|
local function file_is_missing(message)
|
|
return find(message, 'no such file') or find(message, 'File was removed to decrease save file size')
|
|
end
|
|
|
|
return function(name)
|
|
local s, e = pcall(require, name)
|
|
if not s and not file_is_missing(e) then
|
|
error(e, 2)
|
|
end
|
|
end
|