This is a semantics question, but I'm trying to determine the correct Error to throw in the following situation.
I have a process that sometimes is performed multiple times. If the process is performed an additional time before the first time is complete, we have thread protection that raises a DatabaseError
and blocks the process from occurring a second time. Instead of returning the generic DatabaseError
, this raises a custom error that says that the original process is still incomplete.
In lieu of the custom error, is there a "by the books" PEP error that would be more appropriate? I've read through the python PEP for database exceptions and none stuck out to me.