Skip to content

Improve error handling #30

@Klaus-Tockloth

Description

@Klaus-Tockloth
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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions