Use Throw helpers
Closed this issue · 0 comments
edumserrano commented
Implement the ThrowHelper pattern due to the benefits explained here: https://dunnhq.com/posts/2022/throw-helper/
See also:
- https://github.com/dotnet/runtime/blob/9e81ca53137c587bce0f30bf60f13bb10fbdd204/src/libraries/System.Private.CoreLib/src/System/ArgumentNullException.cs#L63
- https://github.com/dotnet/runtime/blob/9e81ca53137c587bce0f30bf60f13bb10fbdd204/src/libraries/System.Private.CoreLib/src/System/ArgumentException.cs#L110
- https://github.com/dotnet/runtime/blob/953f52482ac2460e4b3faff33e4f73c9b30cd7b4/src/libraries/System.Memory/src/System/ThrowHelper.cs
Find places in the library that are throwing exceptions and use the throw helper pattern instead.