deleteRecord() or deleteAllRecords() detect if fails

Is there a way to detect if some records or related records fail to delete, say by some system parameter being set to false? I don’t want to allow a multi-record delete to proceed if some of the records are in use (etc.). Is the acquire lock used for this? If so, does it work within a transaction?

Thank you,
Don