Skip to content

Commit

Permalink
fix: send proper SSE for stderr message in SDK server (#862)
Browse files Browse the repository at this point in the history
Signed-off-by: Donnie Adams <[email protected]>
  • Loading branch information
thedadams authored Sep 27, 2024
1 parent fde5920 commit c61a7ca
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 c61a7ca

Please sign in to comment.