The newest Perl library, v4.13.0 v201702, introduced the "fieldPathElements" field of ApiError. In testing prior to this upgrade, I have noticed that the first fieldPathElements.operations index is always 0 and the second fieldPathElements.operations index is the expected index of the failed job's error.
Dumped ApiError.EntityNotFound xml object:
<fieldPath>operations[20].operand.campaignId</fieldPath>
<fieldPathElements>
<field>operations</field>
<index>0</index>
</fieldPathElements>
<fieldPathElements>
<field>operations</field>
<index>20</index>
</fieldPathElements>
<fieldPathElements>
<field>operand</field>
</fieldPathElements>
<fieldPathElements>
<field>campaignId</field>
</fieldPathElements>
<trigger>CampaignId: 111222333</trigger>
<errorString>EntityNotFound.INVALID_ID</errorString>
<ApiError.Type>EntityNotFound</ApiError.Type>
<reason>INVALID_ID</reason>
Is this behavior expected or is this a bug? If it is expected, should we always handle these errors by parsing the second "operations" attribute?