1
0
mirror of https://github.com/apache/httpd.git synced 2025-08-08 15:02:10 +03:00

Be more verbose when logging syntax errors

git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1305586 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
Stefan Fritsch
2012-03-26 20:59:11 +00:00
parent 6ade43e50b
commit 7b8c246611

View File

@@ -357,24 +357,10 @@ static apr_status_t vm_construct(void **vm, void *params, apr_pool_t *lifecycle_
"loading lua file %s", spec->file); "loading lua file %s", spec->file);
rc = luaL_loadfile(L, spec->file); rc = luaL_loadfile(L, spec->file);
if (rc != 0) { if (rc != 0) {
char *err;
switch (rc) {
case LUA_ERRSYNTAX:
err = "syntax error";
break;
case LUA_ERRMEM:
err = "memory allocation error";
break;
case LUA_ERRFILE:
err = "error opening or reading file";
break;
default:
err = "unknown error";
break;
}
ap_log_perror(APLOG_MARK, APLOG_ERR, 0, lifecycle_pool, APLOGNO(01482) ap_log_perror(APLOG_MARK, APLOG_ERR, 0, lifecycle_pool, APLOGNO(01482)
"Loading lua file %s: %s", "Error loading %s: %s", spec->file,
spec->file, err); rc == LUA_ERRMEM ? "memory allocation error"
: lua_tostring(L, 0));
return APR_EBADF; return APR_EBADF;
} }
lua_pcall(L, 0, LUA_MULTRET, 0); lua_pcall(L, 0, LUA_MULTRET, 0);