ddworken / hishtory

Your shell history: synced, queryable, and in context
https://hishtory.dev
MIT License
2.51k stars 47 forks source link

Wrap errors #101

Closed lsmoura closed 1 year ago

lsmoura commented 1 year ago

returned errors should be wrapped using %w when adding decorations, so that they can be properly queried for using errors.Is or errors.As, such as:

if errors.Is(err, sqlite3.ErrBusy) || errors.Is(err, sqlite3.ErrLocked) { /* do something */ }
ddworken commented 1 year ago

Thank you for this, LGTM!