celestia-node icon indicating copy to clipboard operation
celestia-node copied to clipboard

refactor(share/getter): remove ErrNotFound

Open walldiss opened this issue 1 year ago • 0 comments

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.

walldiss avatar Jun 21 '23 17:06 walldiss