< Back
Print

Throw a PHP exception

A PHP exception shows—but not is—a system crash. Whenever it occurs it means there is a bug or some other defective piece of code that will disturb oder shutdown the application, the process, or the ongoing task. But it can be necessary to single out an erroneous file or specify problems.

In the article you will learn how to throw an PHP exception by using a Job-related task.

WARNING!

Use with caution! Creating a PHP exception by force is a bug localization method for programmers and system administrators. It is therefore NOT recommended for users without technical training!

 

How to create a Job-Related Task

1) Go to Jobs (the so-called Jobcenter) in the SAWSConnector Suite.

2) Select Job-related rasks in the sub-menu.

3) And click on + (‘Add new task‘).

 

Another sub-menu opens where you can specify the basic conditions, for example when the task should start or what happens after the task is done. To learn more about this click on this link.

4) Click on the Task to do box and select ‘Throw a PHP exception‘.

And the Settings menu will open.

Usually there are more boxes to define the task more precisely but since this is a forced crash routine there is only a box for additional conditions.

To learn about this functionality in detail, please click on this LINK.

 

5) To save your progress click on the Save button next to the tabs tail below.

 

Run Example

To fully understand how you can generate a PHP exception it is best demonstrated with a case example.

My goal for this example is to create a PHP exception by running the job ‘Products‘.

 

1) I want to equip my ‘Products‘ job with a PHP exception task.

 

2) Inside the ‘Products‘ job, go to the Job-related tasks and create one by clicking on + (Add new task).

 

3) For a Task to do I select ‘Throw a PHP exception‘.

 

The Settings menu opens.

4) Since I don’t have any more Conditions to set, I just leave them be.

5) So I save my progress.

 

8) This is how my job and job-related task look like by now (the ‘Throw a PHP exception’ job is not shown):

 

9) For the final step I launch ‘Products‘.

 

10) … and enjoy the results – a fully-fledged error message, which is exactly what I wanted:

Was this article helpful?
How can we improve this article?
Please submit the reason for your vote so that we can improve the article.
Table of Contents