Skip to content

Commit 50a6ac1

Browse files
committed
feat: added Stacktrace for scm
1 parent b376cf0 commit 50a6ac1

File tree

1 file changed

+10
-1
lines changed

1 file changed

+10
-1
lines changed

scm.lua

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,16 @@
22
local scm = {}
33

44
function scm:load(name)
5-
return require(name)
5+
local success, result = pcall(function()
6+
return require(name)
7+
end)
8+
if success then
9+
return result
10+
else
11+
print(debug.traceback("Error while loading Module: " .. name))
12+
error(result)
13+
end
14+
615
end
716

817

0 commit comments

Comments
 (0)