Skip to content

Commit 77fb282

Browse files
authored
quick fix for the currently quite dirty error detection for non-map types (#3)
1 parent f822661 commit 77fb282

File tree

1 file changed

+3
-4
lines changed

1 file changed

+3
-4
lines changed

cmd/localstack/custom_interop.go

+3-4
Original file line numberDiff line numberDiff line change
@@ -117,12 +117,11 @@ func NewCustomInteropServer(lsOpts *LsOpts, delegate rapidcore.InteropServer, lo
117117
var errR map[string]any
118118
marshalErr := json.Unmarshal(invokeResp.Body, &errR)
119119

120-
if marshalErr != nil {
121-
log.Fatalln(marshalErr)
120+
isErr := false
121+
if marshalErr == nil {
122+
_, isErr = errR["errorType"]
122123
}
123124

124-
_, isErr := errR["errorType"]
125-
126125
if isErr {
127126
log.Infoln("Sending to /error")
128127
_, err = http.Post(server.upstreamEndpoint+"/invocations/"+invokeR.InvokeId+"/error", "application/json", bytes.NewReader(invokeResp.Body))

0 commit comments

Comments
 (0)