Skip to content
This repository has been archived by the owner on Oct 9, 2023. It is now read-only.

Populate ExecutionError Kind from Container Errors #83

Merged
merged 1 commit into from
May 5, 2020
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions go/tasks/pluginmachinery/ioutils/remote_file_output_reader.go
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,7 @@ func (r RemoteFileOutputReader) ReadError(ctx context.Context) (io.ExecutionErro
ExecutionError: &core.ExecutionError{
Code: "ErrorFileNotFound",
Message: err.Error(),
Kind: core.ExecutionError_SYSTEM,
},
}, nil
}
Expand All @@ -54,6 +55,7 @@ func (r RemoteFileOutputReader) ReadError(ctx context.Context) (io.ExecutionErro
ExecutionError: &core.ExecutionError{
Code: "ErrorFileBadFormat",
Message: fmt.Sprintf("error not formatted correctly, nil error @path [%s]", r.outPath.GetErrorPath()),
Kind: core.ExecutionError_SYSTEM,
},
}, nil
}
Expand All @@ -62,11 +64,14 @@ func (r RemoteFileOutputReader) ReadError(ctx context.Context) (io.ExecutionErro
ExecutionError: &core.ExecutionError{
Code: errorDoc.Error.Code,
Message: errorDoc.Error.Message,
Kind: core.ExecutionError_USER, // TODO: read it from container error once populated by SDK
},
}

if errorDoc.Error.Kind == core.ContainerError_RECOVERABLE {
ee.IsRecoverable = true
}

return ee, nil
}

Expand Down