Join the #BuildWithBuildAgent Challenge! Get recognized, earn exclusive swag, and inspire the ServiceNow Community with what you can build using Build Agent.  Join the Challenge.

Transform map shows errors, but state is 'Complete' instead of 'Complete with errors'

davizhao
Tera Contributor

I have a transform with an explicit transform map script, the gist of the script is:

(function(){

try{

//do some transform, or throw an exception

}catch(exception){

error = true;

log.error("Something bad happened");

}

})();

This appears to be working just fine except for two issues:

1. Even though the 'Errors' field on the transform history shows that errors are correctly generated for a test map, the transform history's state shows as complete instead of complete with errors

2. Generating an error in this way appears to create an weird error message in the log 'null script error'.

Not sure what #2 is about, but it seems to have no effect on the transform, but #1 is not what I expected. What is the best practice to make the state 'Complete with error' when an error is raised in the explicit transform map script?

Thanks

2 REPLIES 2

bobswisshelm
Kilo Contributor


David,



I am seeing exactly the same thing in my new Fuji instance.   I have entered a HI ticket to identify the problem to ServiceNow, but they have not yet provided an explanation or workaround.



I wonder if the 'null script error' message is showing that something died under the covers, and that is also what is preventing the history level error flag from being set.     I tried turning off business rules and making sure that I have a dummy script for each script type ( onStart, onBefore, etc ), but I still got the same error.   I only get the error if I set error = true; If I do other stuff in the script, it completes without displaying the 'null script error';



This is really annoying because I am depending on the history flag to correctly identify jobs that have failed.



Bob


Hi Bob,



Did you receive any feedback regarding your incident on Hi-Service? Would you please share it? I'm experiencing the same issue in our Helsinki instance...


Thanks in advance!



BR


Artem