Repository navigation
Closed
Milestone
Description
Problem
When dagger call returns an error, the contents of the error is printed twice to the screen:
- A first time within the call trace
- A second time at the end of the output
When the call trace is large, or the error message is long, or both, this makes the output very hard to read. The user will often get lost trying to isolate a useful snippet of text to read.
Solution
Only print the error message once, outside the call trace.
| Before | After | |
|---|---|---|
| Show error message within call trace? | Yes | No |
| Show error message after call trace? | Yes | Yes |
Here's an example before the change:
$ dagger call -m github.com/dagger/dagger/sdk/python/runtime base-image
✔ initialize 6.1s
✔ ModuleSource.asModule: Module! 0.6s
✔ Module.initialize: Module! 0.4s
✔ exec go build -o /runtime . 0.3s
✔ exec /runtime 0.1s
✘ pythonSdk: PythonSdk! 0.1s
✘ exec /runtime 0.1s
┃ /src/sdk/python/runtime/internal/dagger/dagger.gen.go:2235
┃ main.New(0x0)
┃ /src/sdk/python/runtime/main.go:63 +0x10c
┃ main.invoke({0x3fe3d0, 0x638e00}, {0x40001824b8, 0x4, 0x8}, {0x40001823f0?, 0x4000104c68?}, {0x0?, 0x40000100e0?}, 0x10?)
┃ /src/sdk/python/runtime/dagger.gen.go:800 +0x174
┃ main.main()
┃ /src/sdk/python/runtime/dagger.gen.go:591 +0x4b0
Error: response from query: input: pythonSdk resolve: call constructor: process "/runtime" did not complete successfully: exit code: 2
Stderr:
panic: runtime error: invalid memory address or nil pointer dereference
[signal SIGSEGV: segmentation violation code=0x1 addr=0x0 pc=0x2c023c]
goroutine 1 [running]:
python-sdk/internal/dagger.(*Directory).WithoutDirectory(...)
/src/sdk/python/runtime/internal/dagger/dagger.gen.go:2235
main.New(0x0)
/src/sdk/python/runtime/main.go:63 +0x10c
main.invoke({0x3fe3d0, 0x638e00}, {0x40001824b8, 0x4, 0x8}, {0x40001823f0?, 0x4000104c68?}, {0x0?, 0x40000100e0?}, 0x10?)
/src/sdk/python/runtime/dagger.gen.go:800 +0x174
main.main()
/src/sdk/python/runtime/dagger.gen.go:591 +0x4b0The same output after the proposed change:
$ dagger call -m github.com/dagger/dagger/sdk/python/runtime base-image
✔ initialize 6.1s
✔ ModuleSource.asModule: Module! 0.6s
✔ Module.initialize: Module! 0.4s
✔ exec go build -o /runtime . 0.3s
✔ exec /runtime 0.1s
✘ pythonSdk: PythonSdk! 0.1s
✘ exec /runtime 0.1s
panic: runtime error: invalid memory address or nil pointer dereference
[signal SIGSEGV: segmentation violation code=0x1 addr=0x0 pc=0x2c023c]
goroutine 1 [running]:
python-sdk/internal/dagger.(*Directory).WithoutDirectory(...)
/src/sdk/python/runtime/internal/dagger/dagger.gen.go:2235
main.New(0x0)
/src/sdk/python/runtime/main.go:63 +0x10c
main.invoke({0x3fe3d0, 0x638e00}, {0x40001824b8, 0x4, 0x8}, {0x40001823f0?, 0x4000104c68?}, {0x0?, 0x40000100e0?}, 0x10?)
/src/sdk/python/runtime/dagger.gen.go:800 +0x174
main.main()
/src/sdk/python/runtime/dagger.gen.go:591 +0x4b0Metadata
Metadata
Assignees
Labels
No labels
Activity
tui: render error logs beneath final print
tui: render error logs beneath final print
tui: render error logs beneath final print
tui: render error logs beneath final print
tui: render error logs beneath final print
tui: render error logs beneath final print
tui: render error logs beneath final print
tui: render error logs beneath final print
tui: render error logs beneath final print
tui: render error logs beneath final print
tui: render error logs beneath final print
tui: render error logs beneath final print
Better errors, cached states, pending states, duration accounting, fe…