compass.utilities.event_log.error_details#

error_details(error)[source]#

Event fields describing an exception and what caused it

Retry wrappers and client libraries re-raise errors as their own (for example, ELM’s “Maximum number of retries (3) exceeded” raised from the OpenAI client’s APIConnectionError, itself raised from an httpx.ReadError). The outermost error alone rarely says what went wrong, so the whole chain is recorded, down to the operating system’s error where there is one (such as a connection reset). Libraries sometimes re-raise with from None, which hides the original error from tracebacks without discarding it; it is still followed here, since that original error is usually the useful one.

Parameters:

error (BaseException) – Exception to describe.

Returns:

dict – error: the exception as "Type: message", followed by the innermost cause when there is one. error_chain (once the exception was raised, or when it has a cause): every exception in the chain, outermost first, each with its full type name, message and, from its traceback, the frames (file, line, function) it was raised through, outermost first; files in this repository are relative to its root. When called while the error is being handled, the outermost error’s frames start with the code that led to the handler, since its traceback starts only there.