Description
Targeting that "some way of locating the issue in the log" specifically ... without dumping unnecessary and probably confusing internals in the HTTP response...
We could have an InternalError class that maintains a counter (or generates a UUID), which we could then put in the log and return as part of the "INTERNAL ERROR" message, either as abort(HTTPStatus.INTERNAL_SERVER_ERROR,message=f"INTERNAL ERROR {code}")
or even as abort(HTTPStatus.INTERNAL_SERVER_ERROR, message="INTERNAL ERROR", debug_code=code)
... combined with the self.logger.error("Internal error {}: something wicked this way comes", code)
I've seen systems use hardcoded inline literals that a developer can look up in source; but a unique generated code would ensure we could easily find the specific instance of a problem even if it had occurred multiple times within the lifetime of the log(s).
Originally posted by @dbutenhof in #2440 (comment)