New, simplified error checking function: ErrorMatches