Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Error() method in withMessage is inappropriate #37

Open
ZipFast opened this issue Jun 18, 2021 · 0 comments
Open

Error() method in withMessage is inappropriate #37

ZipFast opened this issue Jun 18, 2021 · 0 comments

Comments

@ZipFast
Copy link

ZipFast commented Jun 18, 2021

Current Error() method will print the log message first then with the error rfc code, it may be better to print the error rfc code in front of log message.

func (w *withMessage) Error() string  { return w.msg + ": " + w.cause.Error() }

In the case of BR

Error: backup meta file exists in file:////tmp/backup_test/backupmeta, there may be some backup files in the path already, please specify a correct backup directory!: [BR:Common:ErrInvalidArgument]invalid argument

Place [BR:Common:ErrInvalidArgument]invalid argument fieild in front of log message will be better.

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

No branches or pull requests

1 participant