Why did you seperate this function out, and why isn't it nothrow? Throwing errors is fine in nothrow code.