Contents

cancelMigrationWithError(_:)

Cancels the migration with a given error.

Declaration

func cancelMigrationWithError(_ error: any Error)

Parameters

  • error:

    An error object that describes the reason why the migration is canceled.

Discussion

You can invoke this method from anywhere in the migration process to abort the migration. Calling this method causes migrateStore(from:sourceType:options:with:toDestinationURL:destinationType:destinationOptions:) to abort the migration and return error—you should provide an appropriate error to indicate the reason for the cancellation.

See Also

Aborting a Migration