Skip to content

Commit

Permalink
If a product is not found when syncing an old history, this product s…
Browse files Browse the repository at this point in the history
…hould simply be skipped (#4554)
  • Loading branch information
g123k committed Mar 21, 2022
1 parent fca9ce1 commit c6a2d9e
Showing 1 changed file with 4 additions and 2 deletions.
Expand Up @@ -286,8 +286,10 @@ class ProductRepository @Inject constructor(
getUserAgent(Utils.HEADER_USER_AGENT_SEARCH)
)

if (state.status == 0L) throw IOException("Could not sync history. Error with product ${state.code} ")
else {
// Products not found should be skipped
if (state.status == 0L && state.statusVerbose?.contains("not found") != true) {
throw IOException("Could not sync history. Error with product ${state.code} ")
} else if (state.status > 0L) {
val product = state.product!!
val hp = HistoryProduct(
product.productName,
Expand Down

0 comments on commit c6a2d9e

Please sign in to comment.