Skip to content

Commit

Permalink
quick fix for the currently quite dirty error detection for non-map t…
Browse files Browse the repository at this point in the history
…ypes (#3)
  • Loading branch information
dfangl authored Sep 29, 2022
1 parent f822661 commit 77fb282
Showing 1 changed file with 3 additions and 4 deletions.
7 changes: 3 additions & 4 deletions cmd/localstack/custom_interop.go
Original file line number Diff line number Diff line change
Expand Up @@ -117,12 +117,11 @@ func NewCustomInteropServer(lsOpts *LsOpts, delegate rapidcore.InteropServer, lo
var errR map[string]any
marshalErr := json.Unmarshal(invokeResp.Body, &errR)

if marshalErr != nil {
log.Fatalln(marshalErr)
isErr := false
if marshalErr == nil {
_, isErr = errR["errorType"]
}

_, isErr := errR["errorType"]

if isErr {
log.Infoln("Sending to /error")
_, err = http.Post(server.upstreamEndpoint+"/invocations/"+invokeR.InvokeId+"/error", "application/json", bytes.NewReader(invokeResp.Body))
Expand Down

0 comments on commit 77fb282

Please sign in to comment.