I have a simple need to handle 40001 errors in my plsql and retry, according to docs Exception block can help trap the errors and custom logic can be written for retry, but