uniform exception handling, part of 758ca64