当 TolNode="0"时,抛出错“No Data to Send”
THROW HARD EXCEPTION AreEqual(TolNode,"0"), "No Data to Send"
运行后收到错误邮件
Agent CCHN3AZ2ILC004_CCHNIOTILS04_FA_PRD1 on machine CCHN3AZ2ILC004 is reporting the following:
IM Message:Hard transformation exception was detected: Exception executing transformation. Command: #37 THROW HARD EXCEPTION(ID:67) in Field: Build Nodes at Line: (0) Msg: Command threw hard exception because expression evaluated true (AreEqual(TotNode,"0")) No Data to Send Transaction will be put into an error state. AgentUtility ERROR 0 ImportIPObjectData 1/8/2020 3:28:21 AM Transaction:117209 0 OFF 39
在系统中 “Buld Nodes” 是FieldName,如图示,这个错误通知很清楚的写明了,错误发生的位置
以此延伸,我们还可以构造一些其他的错误描述,以检查传入的数据文件的有效性。
如传入的脚本文件未找到指定的组分名称Cr.
RESTART SET BOOKMARK Start Set VARIABLE CompName="" // 从文件中获取CompName Set VARIABLE CompNameCol="9" BOOKMARK: SET AFTER SKIPPING PAST TEXT CompNameStart,Start,CompNameCol,<COMMA> BOOKMARK: SET AFTER SKIPPING TO TEXT CompNameEnd,CompNameStart,1,<COMMA> Set VARIABLE CompName = CopyBetweenBookmarks(CompNameStart,CompNameEnd) THROW HARD EXCEPTION AreEmpty(CompName), "Cannot find Cr, pls check the data file"