Generalize errStr() function so that it can handle any type of errors.