deletes InvalidMetadata is not handled correctly

Previously the InvalidMetadata exception was just reported, but the pipeline did not abort and retry.
Now if the pipeline is not finished it will abort and retry, otherwise just reported.