catch error and create task from inbound action

jean-pauldehaas
Tera Guru

Hi,

 

im creating an inbound action and i want to make sure we catch an error and if there is one a task is created for our team.

 

currently we have this at the end of the inbound action but we dont want to scan the logs every time:

catch (err) {
        gs.debug("EU Finance ERROR: " + err);
 
 
anyone has experience with doing this ?
5 REPLIES 5

Community Alums
Not applicable

Hi @jean-pauldehaas can you please verify change it to gs.error() if you want it logged as an error in ServiceNow logs. This helps track what went wrong, but you don’t need to scan the logs manually.

 

 

yeah i will do that but the main thing is that i want to create a task when an error occures.

any thoughts on that ?

Ankur Bawiskar
Tera Patron
Tera Patron

@jean-pauldehaas 

it's upto you to log the error in system logs

If my response helped please mark it correct and close the thread so that it benefits future readers.

Regards,
Ankur
Certified Technical Architect  ||  9x ServiceNow MVP  ||  ServiceNow Community Leader

i know my question is more how do i create a task when the error happens