I\'ve never been completely happy with the way exception handling works, there\'s a lot exceptions and try/catch brings to the table (stack unwinding, etc.), but it seems to
You could also use a more OO approach:
This has the advantage of naming each type of operation you perform and gives you a Command pattern - operations have been represented as objects.