Page MenuHomeElementl

stop swallowing the causes of exceptions in log strings
ClosedPublic

Authored by sandyryza on Jan 4 2021, 9:19 PM.

Details

Summary

Prior, if an exception was raised from another exception, the sub-exception would not be included in the logs.

Test Plan

bk

Diff Detail

Repository
R1 dagster
Lint
Lint Not Applicable
Unit
Tests Not Applicable

Event Timeline

Harbormaster returned this revision to the author for changes because remote builds failed.Jan 4 2021, 9:35 PM
Harbormaster failed remote builds in B23587: Diff 28679!

can we test how the log message is in console and in dagit

Here's what shows up in Dagit:

image.png (696×1 px, 159 KB)

Here's what shows up in the CLI:

2021-01-05 13:13:35 - dagster - ERROR - error_monster - 5015c300-7e2b-4e7e-8601-5d4af76a86b3 - 22940 - start - STEP_FAILURE - Execution of step "start" failed.

ValueError: outer error

Stack Trace:
  File "/Users/sryza/dagster/python_modules/dagster/dagster/core/errors.py", line 184, in user_code_error_boundary
    yield
  File "/Users/sryza/dagster/python_modules/dagster/dagster/utils/__init__.py", line 356, in iterate_with_context
    next_output = next(iterator)
  File "/Users/sryza/dagster/python_modules/dagster/dagster/core/execution/plan/compute.py", line 99, in _execute_core_compute
    for step_output in _yield_compute_results(compute_context, inputs, compute_fn):
  File "/Users/sryza/dagster/python_modules/dagster/dagster/core/execution/plan/compute.py", line 67, in _yield_compute_results
    for event in user_event_sequence:
  File "/Users/sryza/dagster/python_modules/dagster/dagster/core/definitions/decorators/solid.py", line 227, in compute
    result = fn(context, **kwargs)
  File "/Users/sryza/dagster/python_modules/dagster-test/dagster_test/toys/error_monster.py", line 85, in emit_num
    raise ValueError("outer error") from e

The above exception was the direct cause of the following exception:
ValueError: inner error

Stack Trace:
  File "/Users/sryza/dagster/python_modules/dagster-test/dagster_test/toys/error_monster.py", line 83, in emit_num
    raise ValueError("inner error")

The latter is tested in test_log_manager.py

This revision is now accepted and ready to land.Jan 5 2021, 9:59 PM