2
2
mirror of https://github.com/Hilbis/Hilbish synced 2025-03-27 17:00:41 +00:00

fix: return correct error code and fix error level

This commit is contained in:
TorchedSammy 2021-03-31 07:32:47 -04:00
parent 5500baf5b6
commit a9018a2740

View File

@ -16,7 +16,7 @@ func Loader(L *lua.LState) int {
func LuaErr(L *lua.LState, code int) {
// TODO: Error with a table, with path and error code
L.Error(lua.LNumber(code), 1)
L.Error(lua.LNumber(code), 2)
}
var exports = map[string]lua.LGFunction{
@ -30,7 +30,7 @@ func cd(L *lua.LState) int {
if err != nil {
switch err.(*os.PathError).Err.Error() {
case "no such file or directory":
LuaErr(L, 2)
LuaErr(L, 1)
}
}