Hi Gareth,
I think we should clarify first what you want to achieve:
a) a technical exception undhandled in the BPMN diagram; rollback of the current transaction; creation of an incident
b) an exception handled in the BPMN diagram; no rollback of the current transaction; no incident (since incidents are only created for unhandled technical exceptions)
For b), BPMN errors are the way to go. Then you can simply set a variable you need. If you want to go with a), there is no out of the box way to set a variable since the current transaction is rolled back as you have noticed. In that case, transaction listeners may be a solution to set the variable in a second transaction after the first has been rolled back. However, depending on your process model, the execution may not exist in this second transaction since its creation may have been rolled back as well. See [1] for a transaction listener example.
Cheers,
Thorben
[1]
https://groups.google.com/d/msg/camunda-bpm-users/--fRxgG6JI8/Bb7BFAE46MgJ