Is there a way I can pass back a message from a job execution that will show up a "failure" message manually? There is a failure condition that I want to pass back in a certain situation, but I'm only aware of passing back a success message for a ScheduledJobBase job execute override. Is there a text lookup for the start of that string that would allow me to designate a failure?
As far as I am aware, Episerver will only mark a job execution as failed, if the job throws an exception.
Yupp, what @stefan said. I just tested and that works. So throw a exception :)
public override string Execute()
throw new Exception("This is a custom failure");
Great, thanks to both of you!
It is also important to know that never, ever throw an exception in an async method in your scheduled job. Those will not be catched by the scheduler, and will most likely crash your entire web app.