Clear ErrString before setting it to contain the error string from lua.
If ErrString is longer than the actual message from Lua, then the additional characters are not set and either contain garbage or that part of its previous value. This is not useful information and prevents (e.g.) trim from working correctly. A safe default is hence just to completely clear ErrString before setting it.