Skip to content

Commit ce94643

Browse files
author
Pavel Perehozhih
committed
Merge branch 'release/1.0.0.1'
2 parents 864ed94 + bcf45ac commit ce94643

File tree

2 files changed

+9
-6
lines changed

2 files changed

+9
-6
lines changed

pk-engine/pk-engine/webservice/client_api/url_handler_wrapper.lua

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -59,7 +59,7 @@ do
5959
response_fn,
6060
error_formatter_fn
6161
)
62-
local err, msg = call(
62+
local err, msg, code = call(
6363
error_formatter_fn,
6464
tostring(err_info) or "(error message is not a string)",
6565
api_context
@@ -73,7 +73,7 @@ do
7373
log_error(message)
7474
error(message)
7575
end
76-
return call(response_fn, err, msg)
76+
return call(response_fn, err, msg, code)
7777
end
7878

7979
-- static --------------------------------------------------------------------
@@ -129,6 +129,7 @@ do
129129

130130
local input, err = call(input_loader, api_context)
131131
if not input then
132+
log_error("failed on url:", api_context:request_path_info())
132133
return respond_and_clean_context(api_context, err, response_fn, error_formatter_fn)
133134
end
134135

@@ -192,6 +193,7 @@ do
192193

193194
local input, err = call(input_loader, api_context)
194195
if not input then
196+
log_error("failed on url:", api_context:request_path_info())
195197
return respond_and_clean_context(api_context, err, response_fn, error_formatter_fn)
196198
end
197199

@@ -284,6 +286,7 @@ do
284286

285287
local input, err = call(input_loader, api_context)
286288
if not input then
289+
log_error("failed on url:", api_context:request_path_info())
287290
return respond_and_clean_context(
288291
api_context,
289292
err,

pk-engine/pk-engine/webservice/response.lua

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -42,15 +42,15 @@ local common_html_error = function(error_id)
4242
"string", error_id
4343
)
4444

45-
return '<H1>Error!</H1>' .. error_id -- TODO: Cache results?
45+
return '<H1>Error!</H1>' .. error_id, {}, 500 -- TODO: Cache results?
4646
end
4747

4848
local common_text_error = function(error_id)
4949
arguments(
5050
"string", error_id
5151
)
5252

53-
return 'Error!\n\n' .. error_id -- TODO: Cache results?
53+
return 'Error!\n\n' .. error_id, {}, 500 -- TODO: Cache results?
5454
end
5555

5656
-- Note that error_id is intentionally not escaped.
@@ -60,7 +60,7 @@ local common_xml_error = function(error_id)
6060
"string", error_id
6161
)
6262

63-
return '<error id="' .. error_id .. '"/>' -- TODO: Cache results?
63+
return '<error id="' .. error_id .. '"/>', {}, 500 -- TODO: Cache results?
6464
end
6565

6666
-- Note that error_id is intentionally not escaped.
@@ -70,7 +70,7 @@ local common_json_error = function(error_id)
7070
"string", error_id
7171
)
7272

73-
return '{ "error" : { "id" : "' .. error_id .. '" } }' -- TODO: Cache results?
73+
return '{ "error" : { "id" : "' .. error_id .. '" } }', {}, 500 -- TODO: Cache results?
7474
end
7575

7676
local common_luabins_error = function(error_id)

0 commit comments

Comments
 (0)