Mats,
If you run tests as test items, then you can determine the current test item's name by using the Project.TestItems.Current.Name property.
If you start tests by running a script routine or keyword test, then, unfortunately, there is no way to determine the current test name. A workaround, as Robert wrote, is to use some global storage like Project.Variables or script's global variable that will keep the current test name. Most likely, the number of tests that require unique actions on error is not large. So, you will be able to add code (or keyword test operations) that will save the test name to this variable at the beginning of the test and clear the variable on exit. If you use JScript, you can use the Array object (JScript object) to implement a kind of a stack and use this object's push and pop methods to save and restore test' names.