Verified Commit 59f44046 authored by SlevinWasAlreadyTaken's avatar SlevinWasAlreadyTaken 🔥
Browse files

feat(merror): improve HasCode resiliency by checking nil error

parent b230fb49
......@@ -60,7 +60,7 @@ func AddCodeToURL(req string, code Code) (string, error) {
// HasCode transforms input error into merror and checks if code are matching
func HasCode(err error, code Code) bool {
return transform(err).Co == code
return err != nil && transform(err).Co == code
// ToCode takes a default error and return corresponding Code
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment