Skip to content
This repository has been archived by the owner on Dec 1, 2021. It is now read-only.

[question] Is there a way to get msg from errors.Wrap(code, msg)? #164

Open
allencloud opened this issue Aug 1, 2018 · 2 comments
Open

Comments

@allencloud
Copy link

Hi, I have a question for the project.

Now there is a line of code :

func A() error{
     return errors.Wrap(code, msg)
}

Then I have a caller err := A(), so can I use the returned err to get msg?

Thanks in advance.

@davecheney
Copy link
Member

davecheney commented Aug 1, 2018 via email

@gumingqi
Copy link

I want to set error code,and use it in the caller too

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants