Open jlandahl opened 2 years ago
How about splitting up the line in many lines to isolate exactly which part is causing the error.
The exception is thrown in the JsonEncoder
for strings, which suggests to me that my code has already run and it's trying to turn the returned string into JSON.
Send JSON back already encoded
If you look at how ZLambda
is defined:
abstract class ZLambda[E: JsonDecoder, A: JsonEncoder] extends ZIOAppDefault ...
I don't have any control over the encoding process. It's called automatically after my program returns a string.
Hi @jlandahl,
Can you try to wrap the string with a case class and provide an implicit JsonEncoder for it and see what you get?
BTW, what version of zio-lambda are you using? I'll try to take some time to look into this.
This is happening with 1.0.0-RC6. I'll try what you suggest with a case class and report back.
@jlandahl still having this issue? If not, I'm gonna close this one.
@jlandahl This is working for us right now:
object ProfileQueryLambda extends ZLambda[AwsAPIGatewayProxyRequestEvent, LambdaResponse]
I have a lambda that I've compiled with GraalVM into a native binary. When I try to test it I get the following:
Since it's happening in JsonEncoder's string encoder, I'm guessing that the program ran, but then blew up when trying to render the return string to JSON. Here's the program in question:
Line 3 here is line 10 in the traceback.
Any tips on how to debug this?