conditioned error matching that does not work for os x