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

Improve error handling #30

Open
Klaus-Tockloth opened this issue Nov 3, 2022 · 1 comment
Open

Improve error handling #30

Klaus-Tockloth opened this issue Nov 3, 2022 · 1 comment

Comments

@Klaus-Tockloth
Copy link

v, err := state.GetPath(key)
if err != nil {
	log.Fatalf("error [%v] at state.GetPath()", err)
}

Error message if the 'key" doesn't exists:

2022/11/03 11:48:12.922025 main.go:124: error [github.com/ulfox/dby/db.(*Storage).GetPath#163
: github.com/ulfox/dby/db.(*SQL).getPath#154
: the given key [MissingKey] does not exist] at state.GetPath()

The error message is difficult to handle because the error cause 'does not exist' is not wrapped. So it's difficult to distinguish 'does not exist' from any other possible error.

@ulfox
Copy link
Owner

ulfox commented Nov 15, 2022

Yea, makes sense, it is confusing right now. I will have a look on this when I find some time after work

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

2 participants