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

add detailed logs before every error is returned #20

Open
thomasdfischer opened this issue Jan 27, 2019 · 0 comments
Open

add detailed logs before every error is returned #20

thomasdfischer opened this issue Jan 27, 2019 · 0 comments
Labels
good first issue Good for newcomers

Comments

@thomasdfischer
Copy link
Member

thomasdfischer commented Jan 27, 2019

Also add logs when returning !ok.

For example, this snippet

func parseFileKey(path string) (*backend.FileKey, bool) {
	elems := strings.Split(path, "/")
	if len(elems) < 4 || elems[len(elems)-1] == "" {
		return nil, false
	}

should be transformed to this

func parseFileKey(path string) (*backend.FileKey, bool) {
	elems := strings.Split(path, "/")
	if len(elems) < 4 || elems[len(elems)-1] == "" {
		log.WithFields(log.Fields{
			"path":  path,
			"elems": elems,
		}).Warn("parseFileKey failed")
		return nil, false
	}
@thomasdfischer thomasdfischer added the good first issue Good for newcomers label Jan 27, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
good first issue Good for newcomers
Projects
None yet
Development

No branches or pull requests

1 participant