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
Kernel#puts is documented as returning nil, and that is how it normally behaves:
$ irb
2.7.5 :001 > puts "abc"
abc
=> nil
However, in this project you monkey patchKernel#puts. A (presumably unintended) side effect of that monkey patch is that it changes the return value to an Integer (since that's what AwsLambdaRuntimeInterfaceClient::TelemetryLoggingHelper.telemetry_log_sink.write(msg) returns, and that's the last line of your puts redefinition).
To make your monkey patch safer, it should still return nil from puts (e.g. by adding a last line to the method of nil).
Concretely, this led to an exception I got from code that assumed that puts does indeed return nil but when run in a lambda that wasn't true.
The text was updated successfully, but these errors were encountered:
Kernel#puts
is documented as returningnil
, and that is how it normally behaves:However, in this project you monkey patch
Kernel#puts
. A (presumably unintended) side effect of that monkey patch is that it changes the return value to anInteger
(since that's whatAwsLambdaRuntimeInterfaceClient::TelemetryLoggingHelper.telemetry_log_sink.write(msg)
returns, and that's the last line of yourputs
redefinition).To make your monkey patch safer, it should still return
nil
fromputs
(e.g. by adding a last line to the method ofnil
).Concretely, this led to an exception I got from code that assumed that
puts
does indeed returnnil
but when run in a lambda that wasn't true.The text was updated successfully, but these errors were encountered: