[fix] added optimized version of the get error string function