All,
I'm trying to create URL artifacts in the post-process script of one of my functions, but some of the URLs that are being returned are junk (e.g. 'http://').
When I try to add 'http://' as a URL artifact I get an error. I'm fine with 'http://' not getting added as an artifact, but the error causes the rest of the script/workflow to stop executing.
I could use regex to validate that the URL follows a URL pattern before attempting to add it as a URL artifact, but I feel handling the artifact error would be more robust.
I tried using this try/except:
try:
incident.addArtifact("URL", "http://", "description")
except Exception:
log.info("Artifact creation failed")
pass
but it didn't catch the "Error Running Script: The Script is unable to update the Incident <name> because: The specified URL is invalid: 'http://'" error.
Is there any way to catch/handle the artifact creation error and continue script execution?
Thanks,
------------------------------
Liam Mahoney
------------------------------