Closed MSevey closed 2 months ago
Saw your comment about creating an issue a bit late, I have applied those on the original PR.
Saw your comment about creating an issue a bit late, I have applied those on the original PR.
Thanks for adding the New method, that is a good start. I think there are still other parts of this issue that we should discuss. Lower priority though.
done
Right now the way these errors are being defined and used is quite error prone, specifically as it relates to how we are using the message and params. If a developer doesn't correctly match the number of formatting directives in the message, it will panic when
Error
is called.We can do better :-)
First, we should have a
New
method as that is much safer than manually defining the structs.Second we should make the params more dynamic.
New Method
The new method should be something like this.
Dynamic Params
Instead of relying on a fixed formatted method, we could allow for dynamic params by expecting a key value pair.