Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Extra argument 'onError' #33

Open
Ponyboy47 opened this issue Apr 13, 2017 · 2 comments
Open

Extra argument 'onError' #33

Ponyboy47 opened this issue Apr 13, 2017 · 2 comments

Comments

@Ponyboy47
Copy link

Ponyboy47 commented Apr 13, 2017

So I followed the documentation and I even looked at the source code, but I have no idea why I'm getting this error. This should be acceptable code, but the compiler is telling me it's invalid.

This may not be the best way to do what I'm intending, but I don't know how else to have a job stop itself after it's started.

Jobs.add(name: "startConversion", interval: .minutes(1), autoStart: true, action: {
      log.verbose("Checking if it is time to start converting media...")
      if isTime() {
          startConversion()
          throw ConversionError.stopJob
      }
}, onError: { error in
      return RecoverStrategy.none
})

I get an error that says: extra argument 'onError' in call.

I'm doing exactly what is documented and what is in the source code. I'm using the 1.0.0-beta.1 release, installed with SPM for my project. I'm using swift 3.1 on Ubuntu 16.04

@BrettRToomey
Copy link
Owner

Hmm... My guess would be something to do with the way error isn't being used. Trying changing it to _ and see if your error message improves at all.

@MaherKSantina
Copy link

@Ponyboy47 I think this error is swift related. Swift sometimes displays extra argument in call error when you have a problem in a closure. Your action closure might contain a development error. A possible debug option is to move all the closure code outside the closure and check if it's running correctly.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants