Skip to content

Commit

Permalink
improve generic error message
Browse files Browse the repository at this point in the history
  • Loading branch information
alexey-lysiuk committed Aug 5, 2023
1 parent 0e34c43 commit 1ed7bca
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions Quake/lua_script.c
Original file line number Diff line number Diff line change
Expand Up @@ -214,9 +214,12 @@ static void LUA_Exec(const char* script, const char* filename)

// Remove junk from [string "beginning of script..."]:line: message
const char* nojunkerror = strstr(error, "...\"]:");
Con_SafePrintf("Error while executing Lua script\n%s", filename);

Con_SafePrintf("Error while executing Lua script\n%s%s\n",
filename, nojunkerror ? nojunkerror + 5 : error);
if (nojunkerror)
Con_SafePrintf("%s\n", nojunkerror + 5);
else
Con_SafePrintf(":0: %s\n", error);
}

lua_pop(state, top);
Expand Down

0 comments on commit 1ed7bca

Please sign in to comment.