Consistent and covariant anomalies in the overlap formulation of chiral gauge theories