Skip to content

Commit

Permalink
style: more readable
Browse files Browse the repository at this point in the history
  • Loading branch information
siyul-park committed Dec 2, 2023
1 parent a5b9130 commit c7c29d1
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion pkg/plugin/networkx/http.go
Original file line number Diff line number Diff line change
Expand Up @@ -379,8 +379,9 @@ func (n *HTTPNode) ServeHTTP(w http.ResponseWriter, r *http.Request) {
n.mu.RLock()
defer n.mu.RUnlock()

proc := process.New()
var procErr error
proc := process.New()

defer func() {
proc.Stack().Wait()
proc.Exit(procErr)
Expand All @@ -404,12 +405,14 @@ func (n *HTTPNode) ServeHTTP(w http.ResponseWriter, r *http.Request) {
_ = n.response(r, w, n.errorPayload(proc, UnsupportedMediaType))
return
}

outPayload, err := primitive.MarshalText(req)
if err != nil {
procErr = err
_ = n.response(r, w, n.errorPayload(proc, BadRequest))
return
}

outPck := packet.New(outPayload)

if ioStream.Links() > 0 {
Expand Down

0 comments on commit c7c29d1

Please sign in to comment.