add API to get error string