Apex Jobs error reporting – “Status Detail” needs to be bigger

Force.com provides the Batchable mechanism to allow the processing of large volumes of data to be broken down into batches and spread out over time. This helps Salesforce level demand on its servers. The Apex Jobs list view in Setup provides some basic monitoring and error reporting.

But in a world of nested exceptions where the reported exception may have a “caused by” exception attached (and perhaps multiple levels of this), I can affirm that the 255 character “Status Detail” field (AsyncApexJob.ExtendedStatus) is too short. Here is the error report from a batchable I ran today:

First error: Update failed. First exception on row 0 with id a0AE0000009W2N9MAK; first error: CANNOT_INSERT_UPDATE_ACTIVATE_ENTITY, cve.BenefitClaimedAfterTrigger: execution of AfterUpdate

caused by: System.DmlException: Update failed. First exception…

Pretty hard to figure out the root cause based on the text “…”.

Note that implementing your own pattern of error reporting inside your Batchable won’t always help as some exceptions (such as governor limit ones) can’t be caught. So please vote for Apex Jobs listing “Status Detail” improvements for the benefit of (probably far) future generations of Force.com developers.