Why yes, yes you can!

There are a series of asynchronous events, where you make a call, and it
either suceeds or fails, but then it goes off on its own to do that.

Each of those (amusingly, even Send-email) has an error variable.

In Policy Builder in Designer, right after your Start-Workflow token
call, do a set local variable, in the variable name picker look at the
top and bottom for tabs. one of them will be Error variables.

It is actually buried in the docs, but not something people run into often.

here is an example of how you might do it:

<if-local-variable mode="regex" name="error.do-start-workflow"
<do-send-email server="~smtpServer~" type="text">
<arg-string name="to">
<token-global-variable name="toMajorErrorEmail"/>
<arg-string name="subject">
<token-time format="!LONG.DATETIME" tz="CST"/>
<token-text xml:space="preserve">: Role Creation Error from
<arg-string name="message">
<token-text xml:space="preserve">The Role </token-text>
<token-op-attr name="CN"/>
<token-text xml:space="preserve"> failed to create in IDM, after
being committed in AGS. Please investigate. The error message recieved
on the SOAP call is as follows:

<token-local-variable name="error.do-start-workflow"/>

That is from a JDBC driver syncing roles from AGS to IDM. (Don't ask...)
On 5/9/2012 7:26 AM, Dev Sav wrote:
> I have a Delimited_Text Driver that initiates a workflow. I am able to
> start the workflow successfully. My question is how am I to send an
> email notification from the driver itself to a user (e.g: administrator)
> informing him/her that the workflow cannot be started. Can xpath be used
> in such a scenario? or are there other alternatives? Thanks.
> I will like to kindly inform that I know what the under-mentioned error
> is about and I have already solved it.
> The error message being displayed in the log file of trace level 3 to 5
> is similar to the following:
> DirXML Log Event -------------------
> Driver: \IDVTREE\IDV\UProvDriverSet\StateAndNotification
> Channel: Subscriber
> Object: \IDVTREE\IDV\Users\ttestuserp
> Status: Error
> Message: Code(-9194) Error in
> vnd.nds.stream://IMS_STAGING/services/DriverSet/Person3_Batch_Provisioning/Publisher/pub-etp-Person3_UserAccount_Provisioning#XmlData:160
> : Couldn't start workflow 'CN=User Accounts
> Creation,CN=RequestDefs,CN=AppConfig,CN=UserApplic ation,CN=DriverSet,O=services'
> for recipient 'CN=adminUA,dc=data':
> com.novell.soa.af.impl.soap.AdminException={_Reaso n=Attempt to set value
> on Data item [msdDate] using incorrect type; expecting [date] got
> [01-01-2016]..}