mirror of
https://github.com/token2/snapd.git
synced 2026-03-13 11:15:47 -07:00
This converts the singleton asserts.ErrNotFound to a richer asserts.NotFoundError struct carrying Type and optionally PrimaryKey, similar to store.AssertionNotFoundError which then gets folded with this. This means code doesn't have to worry anymore which is which or to convert between the two. And when possible there is more information around. Though Backstores can continue to return minimal information (Type but not Headers in the new error). A helper asserts.IsNotFound is also added to cover the simple old ==/!= asserts.ErrNotFound needs. This also fixes/adjust some error handling to usually not repeat the richer information twice.