Throw proper exceptions