engine: graph, util: Clean up error printing

We should improve on this more, but at least as a quick fix, stop
splitting the error across two lines. This makes the logs really ugly.
This commit is contained in:
James Shubin
2023-09-01 16:49:50 -04:00
parent 0b1b0a3f80
commit 8299c04fc6
4 changed files with 18 additions and 7 deletions

View File

@@ -400,3 +400,12 @@ func AutoEdgeCombiner(ae ...engine.AutoEdge) (engine.AutoEdge, error) {
ae: ae,
}, nil
}
// CleanError takes the engine errors and prints them on a single line.
// TODO: maybe we can improve this here, it's a bit ugly.
func CleanError(err error) string {
if err == nil {
return fmt.Sprintf("%v", err)
}
return strings.ReplaceAll(err.Error(), "\n", " ")
}