Please enable JavaScript to view this site.

The manual for the JobRouter developer

Navigation: System activities > Use of PHP API methods for the CSV export example > Debug and error handling

Errors and exceptions

Scroll Prev Top Next More

If an error occurs in your system activity and you would like to cancel the execution of it, you can realize this by using exceptions. The execution logic is interrupted, database changes are revoked and the step status is set to error.

Exceptions

<?php

class csvSystemActivity extends AbstractSystemActivityAPI

{

...

    protected function exportCsv()

    {

        $fieldDelimiter = $this->resolveInputParameter('fieldDelimiter');

 

        if ($fieldDelimiter == '') {

            throw new Exception('A separator has to be defined.');

        }

 

        $this->debug('Separator: '.$fieldDelimiter);                

    }

}