celestia-node
celestia-node copied to clipboard
refactor(share/getter): remove ErrNotFound
Implementation ideas
ErrNotFound
is the error that returned when getter is unable to get data. For store getter it indicates that there is no data, while for shrex and ipld getter it is only possible in multiple cases, that in common only possible if user provided ctx deadline was reached or ctx was canceled. So for shrex and ipld getter it implies, that request that returned ErrNotFound
could be retried and succeed. It is inconsistent between multiple getters. and needs to be cleaned up.
There is no need to unified error on getter interface level and we could use:
- store.ErrNotFound local error for store getter
- context error for all other cases.
Remove share.ErrNotFound and all related handling in favour of context errors or generic error handling.