Rewrap onerror hanlder on patchPipe