httpd-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Rainer Jung <rainer.j...@kippdata.de>
Subject Re: svn commit: r1305586 - /httpd/httpd/trunk/modules/lua/lua_vmprep.c
Date Mon, 26 Mar 2012 22:18:02 GMT
On 26.03.2012 22:59, sf@apache.org wrote:
> Author: sf
> Date: Mon Mar 26 20:59:11 2012
> New Revision: 1305586
>
> URL: http://svn.apache.org/viewvc?rev=1305586&view=rev
> Log:
> Be more verbose when logging syntax errors
>
> Modified:
>      httpd/httpd/trunk/modules/lua/lua_vmprep.c
>
> Modified: httpd/httpd/trunk/modules/lua/lua_vmprep.c
> URL: http://svn.apache.org/viewvc/httpd/httpd/trunk/modules/lua/lua_vmprep.c?rev=1305586&r1=1305585&r2=1305586&view=diff
> ==============================================================================
> --- httpd/httpd/trunk/modules/lua/lua_vmprep.c (original)
> +++ httpd/httpd/trunk/modules/lua/lua_vmprep.c Mon Mar 26 20:59:11 2012
> @@ -357,24 +357,10 @@ static apr_status_t vm_construct(void **
>               "loading lua file %s", spec->file);
>           rc = luaL_loadfile(L, spec->file);
>           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)
> -                "Loading lua file %s: %s",
> -                spec->file, err);
> +                          "Error loading %s: %s", spec->file,
> +                          rc == LUA_ERRMEM ? "memory allocation error"
> +                                           : lua_tostring(L, 0));
>               return APR_EBADF;
>           }
>           lua_pcall(L, 0, LUA_MULTRET, 0);

Being more verbose with 14 saved lines is impressive :)

Regards,

Rainer


Mime
View raw message