Tags: modfin/eal
Tags
Fixes panic in UnwrapError (#5) If an error were passed to eal.UnwrapError that wasn't hashable/comparable, a panic were raised when we tried to use it as a map key. Now we check in UnwrapError if the error is comparable before we try to use it as a map key. If one tries to call RegisterErrorLogFunc with an error that isn't comparable we'll still raise a panic since until we can log those, there is no point to call RegisterErrorLogFunc, and that will in most cases happen when initializing the program. The only workaround currently is to either ignore log augmentation for those errors, or change the type to use pointer-receivers to force the creation of those errors to return a pointer to the un-comparable error struct. This commit also fixes some comments and another bug in the internal esl.errorLogger where the "jwt_text" log field contained the error bitfield and not the jwt.ValidationError text.