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
This isn't something that we see is causing a production problem (although perhaps there is a minor robustness issue in the highly improbable production case that any of these fields is not set).
But, it's something that trips us up from time to time in a unit test context - when unit testing some other behavior, it's easy to inadvertently instantiate a ResponseError that will then cause a panic when Error() is called.
If only to simplify unit testing, it would be neat if (*azcore.ResponseError) Error() did not panic on a zero value &azcore.ResponseError{}.
The text was updated successfully, but these errors were encountered:
Bug Report
go version
: go version go1.21.1 linux/amd64The expression
(&azcore.ResponseError{}).Error()
panics because the implementation ofError()
requires multiple internal fields to be set.The minimum instantiation of
azcore.ResponseError
that doesn't panic whenError()
is called is something like:This isn't something that we see is causing a production problem (although perhaps there is a minor robustness issue in the highly improbable production case that any of these fields is not set).
But, it's something that trips us up from time to time in a unit test context - when unit testing some other behavior, it's easy to inadvertently instantiate a ResponseError that will then cause a panic when Error() is called.
If only to simplify unit testing, it would be neat if
(*azcore.ResponseError) Error()
did not panic on a zero value&azcore.ResponseError{}
.The text was updated successfully, but these errors were encountered: