Copy error string to lua buffer before exception.