mirror of https://github.com/databricks/cli.git
Revert "Log job errors using progress logger"
This reverts commit a2e20f5206
.
This commit is contained in:
parent
a2e20f5206
commit
eab29603fc
|
@ -133,9 +133,6 @@ func (r *jobRunner) logFailedTasks(ctx context.Context, runId int64) {
|
||||||
log.Errorf(ctx, "task %s failed. Unable to fetch error trace: %s", red(task.TaskKey), err)
|
log.Errorf(ctx, "task %s failed. Unable to fetch error trace: %s", red(task.TaskKey), err)
|
||||||
continue
|
continue
|
||||||
}
|
}
|
||||||
if progressLogger, ok := cmdio.FromContext(ctx); ok {
|
|
||||||
progressLogger.Log(progress.NewTaskErrorEvent(task.TaskKey, taskInfo.Error, taskInfo.ErrorTrace))
|
|
||||||
}
|
|
||||||
log.Errorf(ctx, "Task %s failed!\nError:\n%s\nTrace:\n%s",
|
log.Errorf(ctx, "Task %s failed!\nError:\n%s\nTrace:\n%s",
|
||||||
red(task.TaskKey), taskInfo.Error, taskInfo.ErrorTrace)
|
red(task.TaskKey), taskInfo.Error, taskInfo.ErrorTrace)
|
||||||
} else {
|
} else {
|
||||||
|
|
|
@ -1,28 +0,0 @@
|
||||||
package progress
|
|
||||||
|
|
||||||
import (
|
|
||||||
"fmt"
|
|
||||||
"strings"
|
|
||||||
)
|
|
||||||
|
|
||||||
type TaskErrorEvent struct {
|
|
||||||
TaskKey string `json:"task_key"`
|
|
||||||
Error string `json:"error"`
|
|
||||||
ErrorTrace string `json:"error_trace"`
|
|
||||||
}
|
|
||||||
|
|
||||||
func NewTaskErrorEvent(taskKey, errorMessage, errorTrace string) *TaskErrorEvent {
|
|
||||||
return &TaskErrorEvent{
|
|
||||||
TaskKey: taskKey,
|
|
||||||
Error: errorMessage,
|
|
||||||
ErrorTrace: errorTrace,
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
func (event *TaskErrorEvent) String() string {
|
|
||||||
result := strings.Builder{}
|
|
||||||
result.WriteString(fmt.Sprintf("Task %s FAILED:\n", event.TaskKey))
|
|
||||||
result.WriteString(event.Error + "\n")
|
|
||||||
result.WriteString(event.ErrorTrace + "\n")
|
|
||||||
return result.String()
|
|
||||||
}
|
|
Loading…
Reference in New Issue