Skip to content

Commit

Permalink
Populate ExecutionError Kind from Container Errors (flyteorg#83)
Browse files Browse the repository at this point in the history
  • Loading branch information
EngHabu committed May 5, 2020
1 parent 87dec02 commit d46c654
Showing 1 changed file with 5 additions and 0 deletions.
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

0 comments on commit d46c654

Please sign in to comment.