You are viewing a plain text version of this content. The canonical link for it is here.
Posted to github@beam.apache.org by GitBox <gi...@apache.org> on 2021/12/27 12:16:29 UTC

[GitHub] [beam] AydarZaynutdinov commented on a change in pull request #16361: [BEAM-13543][Playground] Add logic of sending validation's output on the backend side

AydarZaynutdinov commented on a change in pull request #16361:
URL: https://github.com/apache/beam/pull/16361#discussion_r775475061



##########
File path: playground/backend/internal/code_processing/code_processing.go
##########
@@ -426,16 +428,14 @@ func processError(ctx context.Context, errorChannel chan error, pipelineId uuid.
 	return utils.SetToCache(ctx, cacheService, pipelineId, cache.Status, newStatus)
 }
 
-// processCompileError processes error received during processing compile step.
-// This method sets error output and corresponding status to the cache.
-func processCompileError(ctx context.Context, errorChannel chan error, errorOutput []byte, pipelineId uuid.UUID, cacheService cache.Cache) error {
-	err := <-errorChannel
-	logger.Errorf("%s: Compile(): err: %s, output: %s\n", pipelineId, err.Error(), errorOutput)
+// processErrorWithSavingOutput processes error with saving to cache received error output.
+func processErrorWithSavingOutput(ctx context.Context, err error, errorOutput []byte, pipelineId uuid.UUID, subKey cache.SubKey, cacheService cache.Cache, errorTitle string, newStatus pb.Status) error {
+	logger.Errorf("%s: %s(): err: %s, output: %s\n", pipelineId, errorTitle, err.Error(), errorOutput)
 
-	if err := utils.SetToCache(ctx, cacheService, pipelineId, cache.CompileOutput, fmt.Sprintf("error: %s, output: %s", err.Error(), string(errorOutput))); err != nil {
+	if err := utils.SetToCache(ctx, cacheService, pipelineId, subKey, fmt.Sprintf("error: %s, output: %s", err.Error(), string(errorOutput))); err != nil {

Review comment:
       Changed.




-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: github-unsubscribe@beam.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org