Instead of making this string red before comparing, strip the other of its colour. Then the colour is irrelevant. Or just see if the string contains "error".