webmcp
changeset 314:ba68ef9e7c90
Removed some redundancy from error messages
author | jbe |
---|---|
date | Sun Mar 22 23:10:07 2015 +0100 (2015-03-22) |
parents | d34b7b5e5e5c |
children | 0303fad417e2 |
files | framework/env/execute/chunk.lua framework/env/execute/file_path.lua framework/env/locale/_get_translation_table.lua |
line diff
1.1 --- a/framework/env/execute/chunk.lua Sun Mar 22 23:08:18 2015 +0100 1.2 +++ b/framework/env/execute/chunk.lua Sun Mar 22 23:10:07 2015 +0100 1.3 @@ -35,10 +35,7 @@ 1.4 WEBMCP_BASE_PATH, 'app', app, module, chunk .. '.lua' 1.5 ) 1.6 1.7 - local func, load_errmsg = loadcached(file_path) 1.8 - if not func then 1.9 - error('Could not load file "' .. file_path .. '": ' .. load_errmsg) 1.10 - end 1.11 + local func = assert(loadcached(file_path)) 1.12 1.13 if id or params then 1.14 param.exchange(id, params)
2.1 --- a/framework/env/execute/file_path.lua Sun Mar 22 23:08:18 2015 +0100 2.2 +++ b/framework/env/execute/file_path.lua Sun Mar 22 23:10:07 2015 +0100 2.3 @@ -14,10 +14,7 @@ 2.4 local file_path = args.file_path 2.5 local id = args.id 2.6 local params = args.params 2.7 - local func, load_errmsg = loadcached(file_path) 2.8 - if not func then 2.9 - error('Could not load file "' .. file_path .. '": ' .. load_errmsg) 2.10 - end 2.11 + local func, load_errmsg = assert(loadcached(file_path)) 2.12 if id or params then 2.13 param.exchange(id, params) 2.14 end
3.1 --- a/framework/env/locale/_get_translation_table.lua Sun Mar 22 23:08:18 2015 +0100 3.2 +++ b/framework/env/locale/_get_translation_table.lua Sun Mar 22 23:10:07 2015 +0100 3.3 @@ -11,7 +11,7 @@ 3.4 local filename = encode.file_path(WEBMCP_BASE_PATH, "locale", "translations." .. language_code .. ".lua") 3.5 local func, load_errmsg = loadcached(filename) 3.6 if not func then 3.7 - error('Could not load translation file "' .. filename .. '": ' .. load_errmsg) 3.8 + error('Could not load translation file: ' .. load_errmsg) 3.9 end 3.10 translation_table = func() 3.11 if type(translation_table) ~= "table" then