throw proper exceptions for proper stack traces