Skip to content

Commit

Permalink
fix: send proper SSE for stderr message in SDK server
Browse files Browse the repository at this point in the history
Signed-off-by: Donnie Adams <donnie@acorn.io>
  • Loading branch information
thedadams committed Sep 27, 2024
1 parent fde5920 commit d8db0da
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion pkg/sdkserver/run.go
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,9 @@ func processEventStreamOutput(ctx context.Context, logger mvl.Logger, w http.Res
"stdout": out,
})
case err := <-errChan:
writeError(logger, w, http.StatusInternalServerError, fmt.Errorf("failed to run file: %w", err))
writeServerSentEvent(logger, w, map[string]any{
"stderr": fmt.Sprintf("failed to run: %v", err),
})
}

// Now that we have received all events, send the DONE event.
Expand Down

0 comments on commit d8db0da

Please sign in to comment.