Implent check for (constraint) errors
Implement a check against lore.errors
(if it exists) as described under "Possible Solution" here. If one or more errors are found, print them, rollback any changes from the script,
and abort.
Also implement a flag to disable such check.