I am using delayed_job to perform a system call. This system call invokes a Groovy script.
class Job
def perform
command "groovy file.groovy"
system command
end
def success(job)
# handle success
end
def error(job, exception)
# handle error, exception
end
end
This is all working perfectly but I always get back a "success" status since my groovy always exits correctly. I am currently throwing RuntimeExeptions in the Groovy Script to provoke failing job. When I call system "groovy progra.groovy" and it raises an exception (The groovy program raises an Exception), the return value of system call is, as expected false. But when doing the same via delayed_job, it never accesses the def error method but the def success method.
Do you have any advise on how delayed_job actually controls the returns of the perform method? When does it enter the error or failure hook. Unfortunately I have not found anything on this topic in the documentation.
Thanks in advance