MCPcopy Create free account
hub / github.com/dagger/dagger / log_exception_only

Function log_exception_only

sdk/python/src/dagger/mod/_exceptions.py:101–124  ·  view source on GitHub ↗

Log just this exception, without full traceback. Generates an error log message just for this exception, not the full traceback, including without any chained exceptions. This should be used in cases where this exception has enough information or when the rest of the traceback does

(
    exc: Exception,
    msg: str,
    *args,
    # Extra note to add to the end of the error message when shown on
    # the log, but not included in the dagger.Error message.
    note: str = "",
)

Source from the content-addressed store, hash-verified

99
100
101def log_exception_only(
102 exc: Exception,
103 msg: str,
104 *args,
105 # Extra note to add to the end of the error message when shown on
106 # the log, but not included in the dagger.Error message.
107 note: str = "",
108):
109 """Log just this exception, without full traceback.
110
111 Generates an error log message just for this exception, not the full
112 traceback, including without any chained exceptions.
113
114 This should be used in cases where this exception has enough information
115 or when the rest of the traceback doesn't add anything particularly useful,
116 so there's less noise to sort through while debugging.
117
118 The full traceback will still be included in dag.Error() values which
119 could at some point be optionally shown in the web/cloud UI at some
120 point, but it's also fully available to LLM in the meantim.
121 """
122 if note and hasattr(exc, "add_note"):
123 exc.add_note(note)
124 logger.error(msg, *args, exc_info=(type(exc), exc, None))
125
126
127async def record_exception(exc: Exception):

Callers 3

get_resultMethod · 0.90
_get_parent_instanceMethod · 0.90
_convert_inputsMethod · 0.90

Calls 1

errorMethod · 0.45

Tested by

no test coverage detected