Page 1 of 1

Script exit codes and SAB History

Posted: March 18th, 2014, 7:31 pm
by Eejit
When Sab fails to download, verify, unrar etc, it is shown nice and clear in the history with red text etc and the status for email notifications appears to be set to "False"

However, when a post-processing script exits with anything other than a "0" to show that something has probably gone wrong, SAB still displays this in the history with green text, although with with the exit code at the beginning, and the email status flag is a healthy "true"

Is it possible to alter this so SAB's history shows this as a failure in red (or orange to designate a script failure) and the email notification status set to "False", possibly by use of a special exit code such as "9999" so as not to interfere with existing
post-processing scripts?

Re: Script exit codes and SAB History

Posted: March 20th, 2014, 4:41 am
by shypike
On the todo list now.

Re: Script exit codes and SAB History

Posted: March 20th, 2014, 5:01 am
by Eejit
Thanks very much :-)

Re: Script exit codes and SAB History

Posted: March 26th, 2014, 5:26 am
by hugepants
Thanks shypike, hopefully this will resolve this issue where my workaround did not work in every case.

Re: Script exit codes and SAB History

Posted: November 1st, 2014, 1:32 pm
by wiggy9906
Hi,

Is there an exit code I can use to mark the job failed, or is this something still on the todo list?

Wiggy

Re: Script exit codes and SAB History

Posted: November 1st, 2014, 2:06 pm
by shypike

Re: Script exit codes and SAB History

Posted: November 1st, 2014, 4:37 pm
by wiggy9906
Hi Shypike,

Thank you for the reply.

The parameters you refer to are inputs into the post processing script. I'm looking for the capability for the script to pass an exit code back to Sabnzbd that will mark the job as failed. I can't seem to do this at present. The exit code is showed in the results, if not 0, but the job status is completed, not failed.

Wiggy

Re: Script exit codes and SAB History

Posted: November 2nd, 2014, 4:17 am
by shypike
Ok, so you want the script to tell SABnzbd that things went wrong?
Currently SABnzbd will register the code but will not use it to "fail" the job.
This could be implemented but will require an option, to preserve compatibility with existing scripts
that aren't careful with their exit codes.
It's on the todo list now.

Re: Script exit codes and SAB History

Posted: November 2nd, 2014, 4:51 am
by wiggy9906
Thanks Shypike

Re: Script exit codes and SAB History

Posted: January 15th, 2016, 8:03 am
by shypike
Implemented as "User script can flag job as failed" in Config->Switches.

Re: Script exit codes and SAB History

Posted: January 16th, 2016, 4:11 am
by Eejit
Thanks shypike :-)