From b94f6d148193f91cab50d16e2873095827b89b1b Mon Sep 17 00:00:00 2001 From: amelia squires Date: Wed, 15 Oct 2025 16:50:46 -0500 Subject: better errors and docs --- src/net/lua.c | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-) (limited to 'src/net/lua.c') diff --git a/src/net/lua.c b/src/net/lua.c index ab112fe..829c2f7 100644 --- a/src/net/lua.c +++ b/src/net/lua.c @@ -221,12 +221,8 @@ int l_sendfile(lua_State* L){ lua_gettable(L, -2); int header = lua_gettop(L); - if(access(path, F_OK)) { - p_fatal("file not found"); //TODO: use diff errors here - } - if(access(path, R_OK)){ - p_fatal("missing permissions"); - } + luaI_assert(L, !access(path, F_OK) /*file not found*/); + luaI_assert(L, !access(path, R_OK) /*missing permissions*/); lua_pushstring(L, "Content-Type"); lua_gettable(L, header); -- cgit v1.2.3