Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
reqUser = friends.UserFriends.gql("where udid =:1", str(udid) ).get() reqUserName = reqUser.userName
これは私のコードです。このエラーの処理方法を知りたいのですが、このエラーは 2 行目で発生します。
pythons try/except ペアを使用できます。
reqUser = friends.UserFriends.gql("where udid =:1", str(udid) ).get() try: reqUserName = reqUser.userName except AttributeError: reqUserName = "No username found!"
これは AttributeError 例外のみをキャッチするため、それ以外は引き続き発生します。