# HG changeset patch # User Kim Alvefur # Date 1650192733 -7200 # Node ID d5612dcf6733aaa77cc146f7da9b06a8692f1e13 # Parent 77b7e13222812faa01ba63be2c25ef932928a97b mod_rest/apidemo: Don't show traceback to users on config/resource problem diff -r 77b7e1322281 -r d5612dcf6733 mod_rest/apidemo.lib.lua --- a/mod_rest/apidemo.lib.lua Sun Apr 17 12:51:45 2022 +0200 +++ b/mod_rest/apidemo.lib.lua Sun Apr 17 12:52:13 2022 +0200 @@ -11,7 +11,12 @@ }); local index do - local f = assert(io.open(api_demo.."/index.html"), "'rest_demo_resources' should point to the 'dist' directory"); + local f, err = io.open(api_demo.."/index.html"); + if not f then + module:log("error", "Could not open resource: %s", err); + module:log("error", "'rest_demo_resources' should point to the 'dist' directory"); + return _M + end index = f:read("*a"); f:close();