%Installer Manifest: How to ignore several kinds of compilation errors?
Due to a new project I'm getting involved inside %Installer stuff deeper than ever I'd be happy to. Most of it was pretty easy to get, thanks to documentation, articles and SAMPLES example, while I can't dig good solution for one problem. I'm trying to import and compile some classes, willing to ignore two types of errors: 5202 (NothingToCompile) and 5373 (PredecessorClassDoesNotExist - a normal case when SNMP sampling class is compiled for the 1st time, before it was registered).
I've tried the following:
<If Condition='#{##class(%File).Exists("${AddonDir}/AddClasses.xml")}'> <Import File="${AddonDir}/AddClasses.xml" IgnoreErrors="5202,5373" Flags="ck" /> </If>
While it was compiled w/o errors, the mainfest execution failed with error:
03/28/17-16:20:29:521 (2728) 2 Error: #5002: <PARAMETER>zImport^%Installer.Installer.1
I've found a code inside %Installer.Installer::Import():
If $$$ISERR(tSC),(pIgnoreErrors=1)||((","_pIgnoreErrors_",")[(","_$P($system.Status.GetErrorCodes(tSC),",")_",")) { Do ..Log(2,"Import","Ignoring Errors: ("_$P($system.Status.GetErrorCodes(tSC),",")_") "_$system.Status.GetErrorText(tSC)) Set tSC = $$$OK }
which reassured me that IgnoreErrors can be a comma separated list.
I understand that I can split my classes' export in two files and ignore all errors for 'buggy' one of them by setting IgnoreErrors="1", but still eager to know if more elegant solution exists.
Thank you.