Error on missing background

Hi, does anyone know if there is a way of getting the workflow to notify me if there is a background missing from a template.
I have a template that uses a variable which contains a filename that inserts the background from a folder on the disk. At the moment if the background file is missing the output shows a red cross. It would be very useful if there was a way the error passed through to the workflow so I could stop the process and send a notification.
Any help would be greatly appreciated.

Hello @Chris_Tubb,

Yes, there actually is. Please check the article ‘Handling missing images (link)’ for this.

Thanks Marten, that is exactly what I need. Is there any tutorial anywhere showing how to use these functions in workflow. I cannot see how to implement it from this.

The following (expected) error will occur by executing the Create Print Content- or All in One Workflow plugin when you have applied the following Standard Script to your Print Template and have send this Print Template to the PReS Connect Workflow service.

What happen next once the error does occur by executing the Create Print Content- or All in One Workflow plugin depends on the settings applied to the On Error tab of the Properties window of the Workflow plugin.


Error

W3001 : Error while executing plugin: HTTP/1.1 500 An unspecified error occurred which was caused by LoggedApplicationException: There was an error running the content creation process caused by Missing images (SRV000001)


Standard Script

Name: Example
Selector: [data-broken-image]
JavaScript code:

fatalError("Missing images");

Hi Marten, thank you for this, but I cannot get it to work. Could you tell me is this a recent addition as I am still running version 2021.1?

That’s correct, it won’t work in version 2021.1. The data-broken-image attribute has been introduced in version 2023.1.