It got past that line. If the error object has a toJson() (which is not guaranteed), customary in Dart is to return Map<String, dynamic>, which is not what utf8.encode() expects.
I think a more stable solution is to simply call toString() on the error object.
When the runtime tries posting an invocation error I got this
When I changed this line: https://github.com/awslabs/aws-lambda-dart-runtime/blob/2e61c448f4472f42bd605c5fb03f065e9edfe50c/lib/client/client.dart#L156 to this:
It got past that line. If the error object has a
toJson()
(which is not guaranteed), customary in Dart is to returnMap<String, dynamic>
, which is not whatutf8.encode()
expects. I think a more stable solution is to simply calltoString()
on the error object.