JSON decoder errors aren't properly logged
Bug #1193211 reported by
Vadim Peretokin
This bug affects 1 person
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
Mudlet |
Fix Released
|
Undecided
|
Chris |
Bug Description
I saw this in the errors view:
[ERROR:] object:<JSON decoder error:> function:
<>
With no JSON error attached. Looking at the code:
string e;
if( lua_isstring( L, 1 ) )
{
e = "Lua error:";
e += lua_tostring( L, 1 );
}
QString _n = "JSON decoder error:";
QString _f = "json_to_value";
It should be using -1 as the index for the top of the stack, because 1 might not be the top (which seems to be the case in my error).
Changed in mudlet: | |
status: | Fix Committed → Fix Released |
To post a comment you must log in.
That is to say, the fixed code should be:
string e;
logError( e, _n, _f );
if( lua_isstring( L, -1 ) )
{
e = "Lua error:";
e += lua_tostring( L, -1 );
}
QString _n = "JSON decoder error:";
QString _f = "json_to_value";