SimonErm / react-native-job-queue

Easy to use react-native queuing library
https://simonerm.github.io/react-native-job-queue/
122 stars 33 forks source link

How to mark job as failed #50

Closed projuljustin closed 3 years ago

projuljustin commented 3 years ago

Is there a proper way to mark a job as failed to be retried?

Under certain circumstances I want the job to fail, then I reprocess it later. The main place I do this is during a photo upload. Currently I'm doing this by throwing a new error in the upload error listener, which is caught in my try, catch. However if I don't throw an error in the catch statement, the job succeeds and is not retried. I added a throw error to the catch, but this crashes the app it seems. Maybe I'm just not thinking this through, but I figured it wouldn't hurt to ask.

SimonErm commented 3 years ago

Can you provide a code example? I would use the rethrowing approach or if you don't do any further handling just don't catch it.

projuljustin commented 3 years ago

Chased that issue for several hours, ended up being a copy paste error. My apologies, need more coffee I guess :)