Thanks for the help - "do" does the job I was looking for. My dirty ugly code was just knocked up to give a flavour of what I was trying to do - and I had missed a print verb before the "actual error" line - it's not real production code. The comma after the first print should be a semi-colon and there should be a semi-colon after the closing curly bracket, my missing a print verb before the Actual error string probably led to this omission and my confusion! Thanks for the help though I am wondering exactly, typo apart, what is dirty and ugly about it?