change: made the error messages for regex compilation failures less verbose.
This commit is contained in:
Родитель
4806fc2eef
Коммит
35e6a65f9f
|
@ -288,11 +288,7 @@ ngx_http_lua_ngx_re_match(lua_State *L)
|
||||||
dd("compile failed");
|
dd("compile failed");
|
||||||
|
|
||||||
lua_pushnil(L);
|
lua_pushnil(L);
|
||||||
|
lua_pushlstring(L, (char *) re_comp.err.data, re_comp.err.len);
|
||||||
re_comp.err.data[re_comp.err.len] = '\0';
|
|
||||||
msg = lua_pushfstring(L, "failed to compile regex \"%s\": %s",
|
|
||||||
pat.data, re_comp.err.data);
|
|
||||||
|
|
||||||
return 2;
|
return 2;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -711,11 +707,7 @@ ngx_http_lua_ngx_re_gmatch(lua_State *L)
|
||||||
dd("compile failed");
|
dd("compile failed");
|
||||||
|
|
||||||
lua_pushnil(L);
|
lua_pushnil(L);
|
||||||
|
lua_pushlstring(L, (char *) re_comp.err.data, re_comp.err.len);
|
||||||
re_comp.err.data[re_comp.err.len] = '\0';
|
|
||||||
msg = lua_pushfstring(L, "failed to compile regex \"%s\": %s",
|
|
||||||
pat.data, re_comp.err.data);
|
|
||||||
|
|
||||||
return 2;
|
return 2;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -1397,11 +1389,7 @@ ngx_http_lua_ngx_re_sub_helper(lua_State *L, unsigned global)
|
||||||
|
|
||||||
lua_pushnil(L);
|
lua_pushnil(L);
|
||||||
lua_pushnil(L);
|
lua_pushnil(L);
|
||||||
|
lua_pushlstring(L, (char *) re_comp.err.data, re_comp.err.len);
|
||||||
re_comp.err.data[re_comp.err.len] = '\0';
|
|
||||||
msg = lua_pushfstring(L, "failed to compile regex \"%s\": %s",
|
|
||||||
pat.data, re_comp.err.data);
|
|
||||||
|
|
||||||
return 3;
|
return 3;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -241,7 +241,7 @@ hello
|
||||||
--- request
|
--- request
|
||||||
GET /re
|
GET /re
|
||||||
--- response_body_like chop
|
--- response_body_like chop
|
||||||
^(?:FAIL: bad argument \#2 to '\?' \(failed to compile regex "HELLO\.\{2\}": pcre_compile\(\) failed: this version of PCRE is not compiled with PCRE_UTF8 support in "HELLO\.\{2\}" at "HELLO\.\{2\}"\)|hello章亦)$
|
^(?:FAIL: bad argument \#2 to '\?' \(pcre_compile\(\) failed: this version of PCRE is not compiled with PCRE_UTF8 support in "HELLO\.\{2\}" at "HELLO\.\{2\}"\)|hello章亦)$
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
@ -362,7 +362,7 @@ he
|
||||||
--- request
|
--- request
|
||||||
GET /re
|
GET /re
|
||||||
--- response_body
|
--- response_body
|
||||||
error: failed to compile regex "(abc": pcre_compile() failed: missing ) in "(abc"
|
error: pcre_compile() failed: missing ) in "(abc"
|
||||||
--- no_error_log
|
--- no_error_log
|
||||||
[error]
|
[error]
|
||||||
|
|
||||||
|
@ -649,7 +649,7 @@ regex: (?:>[\w\s]*</?\w{2,}>)
|
||||||
--- request
|
--- request
|
||||||
GET /re
|
GET /re
|
||||||
--- response_body
|
--- response_body
|
||||||
error: failed to compile regex "([0-9]+": pcre_compile() failed: missing ) in "([0-9]+"
|
error: pcre_compile() failed: missing ) in "([0-9]+"
|
||||||
|
|
||||||
--- no_error_log
|
--- no_error_log
|
||||||
[error]
|
[error]
|
||||||
|
|
|
@ -699,7 +699,7 @@ not matched!
|
||||||
--- request
|
--- request
|
||||||
GET /re
|
GET /re
|
||||||
--- response_body
|
--- response_body
|
||||||
error: failed to compile regex "(abc": pcre_compile() failed: missing ) in "(abc"
|
error: pcre_compile() failed: missing ) in "(abc"
|
||||||
--- no_error_log
|
--- no_error_log
|
||||||
[error]
|
[error]
|
||||||
|
|
||||||
|
|
|
@ -476,7 +476,7 @@ a [b c] [b] [c] [] [] d
|
||||||
--- request
|
--- request
|
||||||
GET /re
|
GET /re
|
||||||
--- response_body
|
--- response_body
|
||||||
error: failed to compile regex "(abc": pcre_compile() failed: missing ) in "(abc"
|
error: pcre_compile() failed: missing ) in "(abc"
|
||||||
--- no_error_log
|
--- no_error_log
|
||||||
[error]
|
[error]
|
||||||
|
|
||||||
|
|
|
@ -338,7 +338,7 @@ he
|
||||||
--- request
|
--- request
|
||||||
GET /re
|
GET /re
|
||||||
--- response_body
|
--- response_body
|
||||||
error: failed to compile regex "(abc": pcre_compile() failed: missing ) in "(abc"
|
error: pcre_compile() failed: missing ) in "(abc"
|
||||||
--- no_error_log
|
--- no_error_log
|
||||||
[error]
|
[error]
|
||||||
|
|
||||||
|
|
|
@ -122,7 +122,7 @@ pcre JIT compiling result: 1
|
||||||
--- request
|
--- request
|
||||||
GET /re
|
GET /re
|
||||||
--- response_body
|
--- response_body
|
||||||
error: failed to compile regex "(abc": pcre_compile() failed: missing ) in "(abc"
|
error: pcre_compile() failed: missing ) in "(abc"
|
||||||
--- no_error_log
|
--- no_error_log
|
||||||
[error]
|
[error]
|
||||||
|
|
||||||
|
|
|
@ -208,7 +208,7 @@ pcre JIT compiling result: 1
|
||||||
--- request
|
--- request
|
||||||
GET /re
|
GET /re
|
||||||
--- response_body
|
--- response_body
|
||||||
error: failed to compile regex "(abc": pcre_compile() failed: missing ) in "(abc"
|
error: pcre_compile() failed: missing ) in "(abc"
|
||||||
--- no_error_log
|
--- no_error_log
|
||||||
[error]
|
[error]
|
||||||
|
|
||||||
|
|
|
@ -213,7 +213,7 @@ hello
|
||||||
--- request
|
--- request
|
||||||
GET /re
|
GET /re
|
||||||
--- response_body
|
--- response_body
|
||||||
error: failed to compile regex "(abc": pcre_compile() failed: missing ) in "(abc"
|
error: pcre_compile() failed: missing ) in "(abc"
|
||||||
--- no_error_log
|
--- no_error_log
|
||||||
[error]
|
[error]
|
||||||
|
|
||||||
|
|
|
@ -116,7 +116,7 @@ pcre JIT compiling result: 1
|
||||||
--- request
|
--- request
|
||||||
GET /re
|
GET /re
|
||||||
--- response_body
|
--- response_body
|
||||||
error: failed to compile regex "(abc": pcre_compile() failed: missing ) in "(abc"
|
error: pcre_compile() failed: missing ) in "(abc"
|
||||||
--- no_error_log
|
--- no_error_log
|
||||||
[error]
|
[error]
|
||||||
|
|
||||||
|
@ -137,7 +137,7 @@ error: failed to compile regex "(abc": pcre_compile() failed: missing ) in "(abc
|
||||||
--- request
|
--- request
|
||||||
GET /re
|
GET /re
|
||||||
--- response_body
|
--- response_body
|
||||||
error: failed to compile regex "(abc": pcre_compile() failed: missing ) in "(abc"
|
error: pcre_compile() failed: missing ) in "(abc"
|
||||||
--- no_error_log
|
--- no_error_log
|
||||||
[error]
|
[error]
|
||||||
|
|
||||||
|
|
|
@ -109,7 +109,7 @@ hello, world: 0
|
||||||
--- request
|
--- request
|
||||||
GET /re
|
GET /re
|
||||||
--- response_body
|
--- response_body
|
||||||
error: failed to compile regex "(abc": pcre_compile() failed: missing ) in "(abc"
|
error: pcre_compile() failed: missing ) in "(abc"
|
||||||
--- no_error_log
|
--- no_error_log
|
||||||
[error]
|
[error]
|
||||||
|
|
||||||
|
@ -131,7 +131,7 @@ error: failed to compile regex "(abc": pcre_compile() failed: missing ) in "(abc
|
||||||
--- request
|
--- request
|
||||||
GET /re
|
GET /re
|
||||||
--- response_body
|
--- response_body
|
||||||
error: failed to compile regex "(abc": pcre_compile() failed: missing ) in "(abc"
|
error: pcre_compile() failed: missing ) in "(abc"
|
||||||
--- no_error_log
|
--- no_error_log
|
||||||
[error]
|
[error]
|
||||||
|
|
||||||
|
|
|
@ -116,7 +116,7 @@ pcre JIT compiling result: 1
|
||||||
--- request
|
--- request
|
||||||
GET /re
|
GET /re
|
||||||
--- response_body
|
--- response_body
|
||||||
error: failed to compile regex "(abc": pcre_compile() failed: missing ) in "(abc"
|
error: pcre_compile() failed: missing ) in "(abc"
|
||||||
--- no_error_log
|
--- no_error_log
|
||||||
[error]
|
[error]
|
||||||
|
|
||||||
|
@ -137,7 +137,7 @@ error: failed to compile regex "(abc": pcre_compile() failed: missing ) in "(abc
|
||||||
--- request
|
--- request
|
||||||
GET /re
|
GET /re
|
||||||
--- response_body
|
--- response_body
|
||||||
error: failed to compile regex "(abc": pcre_compile() failed: missing ) in "(abc"
|
error: pcre_compile() failed: missing ) in "(abc"
|
||||||
--- no_error_log
|
--- no_error_log
|
||||||
[error]
|
[error]
|
||||||
|
|
||||||
|
|
|
@ -109,7 +109,7 @@ hello, world: 0
|
||||||
--- request
|
--- request
|
||||||
GET /re
|
GET /re
|
||||||
--- response_body
|
--- response_body
|
||||||
error: failed to compile regex "(abc": pcre_compile() failed: missing ) in "(abc"
|
error: pcre_compile() failed: missing ) in "(abc"
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
@ -128,7 +128,7 @@ error: failed to compile regex "(abc": pcre_compile() failed: missing ) in "(abc
|
||||||
--- request
|
--- request
|
||||||
GET /re
|
GET /re
|
||||||
--- response_body
|
--- response_body
|
||||||
error: failed to compile regex "(abc": pcre_compile() failed: missing ) in "(abc"
|
error: pcre_compile() failed: missing ) in "(abc"
|
||||||
--- no_error_log
|
--- no_error_log
|
||||||
[error]
|
[error]
|
||||||
|
|
||||||
|
|
Загрузка…
Ссылка в новой задаче