Replacing error logging with runtime exceptions