Replacing raise with throw to avoid pointless stack tracing