Skip to content

paginator: Stop getting next element on error

Detlev Casanova requested to merge detlev/chronodata:fix-async-panic into main

When paginator::get() hits an error, the stream must stop trying to get the next elements.

If not, the program will panic with:

    thread 'main' panicked at '`async fn` resumed after completion'

There are 2 kinds of errors that can occur in this case:

  • a global error on the request (e.g.: 403 forbidden, no network, ...)
  • a single T error (e.g.: missing json field, ...)

The API seems to be unable to differentiate those two, so let's consider that any kind of error is fatal and stop as soon as there is a problem with the request or the data.

Edited by Detlev Casanova

Merge request reports