File tree Expand file tree Collapse file tree 1 file changed +9
-7
lines changed
Expand file tree Collapse file tree 1 file changed +9
-7
lines changed Original file line number Diff line number Diff line change @@ -174,17 +174,19 @@ wsApp env party tracer chain history callback nodeStateP networkInfoP responseCh
174174 Right input -> do
175175 traceWith tracer (APIInputReceived $ toJSON input)
176176 NodeState {headState} <- atomically getLatestNodeState
177- case HeadState. getOpenStateConfirmedSnapshot headState of
178- Nothing -> callback input
179- Just confirmedSnapshot ->
180- case input of
181- SafeClose -> do
177+ case input of
178+ SafeClose ->
179+ case HeadState. getOpenStateConfirmedSnapshot headState of
180+ Nothing -> callback input
181+ Just confirmedSnapshot ->
182182 case checkNonADAAssets confirmedSnapshot of
183183 Left nonADAValue -> do
184184 let clientInput = decodeUtf8With lenientDecode $ toStrict msg
185- traceWith tracer (APIInvalidInput (" Cannot SafeClose with non-ADA assets present: " <> show nonADAValue) clientInput)
185+ let errorStr = " Cannot SafeClose with non-ADA assets present: " <> show nonADAValue
186+ sendTextData con $ Aeson. encode $ InvalidInput errorStr clientInput
187+ traceWith tracer (APIInvalidInput errorStr clientInput)
186188 Right _ -> callback input
187- _ -> callback input
189+ _ -> callback input
188190 Left e -> do
189191 -- XXX(AB): toStrict might be problematic as it implies consuming the full
190192 -- message to memory
You can’t perform that action at this time.
0 commit comments