When people create modules that save bad values into Semantic Objects, the calling page errors out as HTTP error 500. In the example someone tried to save an iterator into a property, which obviously does not work, getting an error 500 instead of an error message was not very obvious to them though. Returning an error message instead of a hard error 500 would probably be advisable.
PHP Recoverable fatal error: Object of class LuaSandboxFunction could not be converted to string in /extensions/SemanticScribunto/src/ScribuntoLuaLibrary.php on line 363
Steps to reproduce the observation (recommendation is to use the sandbox):
Example Module:
local p = {}
function p.t()
local dataStore = {}
dataStore['some property'] = mw.text.gsplit('some','strings')
mw.smw.set(dataStore)
-- mw.smw.subobject(dataStore) -- this produces the same result
end
return p
and the module would simply be called as {{#invoke:Module name|t}}
Given it is easy to work around this by not passing broken things in, I do not think this is super urgent, but it might be a nice to have to catch such errors.
Setup and configuration
3.1.0
2.1.0
1.31.5
10.4.10-MariaDB-1:10.4.10+maria~buster
7.3.11-1+0~20191026.48+debian9~1.gbpf71ca0 (fpm-fcgi)
Issue
When people create modules that save bad values into Semantic Objects, the calling page errors out as HTTP error 500. In the example someone tried to save an iterator into a property, which obviously does not work, getting an error 500 instead of an error message was not very obvious to them though. Returning an error message instead of a hard error 500 would probably be advisable.
Produces a stack trace and outputs:
Steps to reproduce the observation (recommendation is to use the sandbox):
Example Module:
and the module would simply be called as
{{#invoke:Module name|t}}
Given it is easy to work around this by not passing broken things in, I do not think this is super urgent, but it might be a nice to have to catch such errors.