You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
When a lambda is invoked as an event (or DryRun) there is no data in the response body. Aeson then gets an empty string and fails with a SerializeError
E.g.
[Raw Response Body] {
}
[SerializeError] {
service = Lambda
status = 202 Accepted
message = Error in $: not enough input
body = Just
}
aws01: SerializeError (SerializeError' {_serializeAbbrev = Abbrev "Lambda", _serializeStatus = Status {statusCode = 202, statusMessage = "Accepted"}, _serializeBody = Just "", _serializeMessage = "Error in $: not enough input"})
An AWSRequest instance like this avoids the issue
instance AWSRequest Invoke where
type Rs Invoke = InvokeResponse
request = postBody lambda
response =
(deserialise bodyDecode')
(\ s h x ->
InvokeResponse' <$>
(h .#? "X-Amz-Function-Error") <*>
(h .#? "X-Amz-Log-Result")
<*> (pure (Just x))
<*> (pure (fromEnum s)))
where
bodyDecode' :: LazyByteString -> Either [Char] (HashMap Text Value)
bodyDecode' bs =
if bs == ""
then Right $ Map.empty
else eitherDecode' bs
The text was updated successfully, but these errors were encountered:
When a lambda is invoked as an event (or DryRun) there is no data in the response body. Aeson then gets an empty string and fails with a SerializeError
E.g.
An AWSRequest instance like this avoids the issue
The text was updated successfully, but these errors were encountered: