newrelic-dotnet-agent icon indicating copy to clipboard operation
newrelic-dotnet-agent copied to clipboard

misuse of ArgumentNullException in LambdaTracer.Extract

Open rittneje opened this issue 3 years ago • 2 comments

https://github.com/newrelic/newrelic-dotnet-agent/blob/721825bcad66bb1036a00752de2c2c989e1114d0/src/AwsLambda/AwsLambdaOpenTracer/LambdaTracer.cs#L110-L115

The parameter for ArgumentNullException is supposed to be the name of the parameter that was null, not a message. Furthermore, ArgumentNullException is intended for when one of the function parameters is null. Please change it to ArgumentException or InvalidOperationException instead.

rittneje avatar Oct 24 '22 16:10 rittneje

https://issues.newrelic.com/browse/NEWRELIC-4794

Hi @rittneje Thank you for pointing this out! It was a simple change so I went ahead and submitted a PR to correct the incorrect type.

Here is the PR: https://github.com/newrelic/newrelic-dotnet-agent/pull/1287

jaffinito avatar Oct 26 '22 16:10 jaffinito

Just quick update, the PR has been merged and when we release the Lambda agent again, it will have the updated error type. I am go ahead and close this issue. Thank you again for helping to improve our agent!

jaffinito avatar Oct 27 '22 16:10 jaffinito