make sure error code is a string