newrelic-dotnet-agent
newrelic-dotnet-agent copied to clipboard
misuse of ArgumentNullException in LambdaTracer.Extract
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.
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
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!