lib/githu3/org.rb in githu3-0.0.2 vs lib/githu3/org.rb in githu3-0.0.3
- old
+ new
@@ -7,14 +7,22 @@
has_many :teams
has_many :members, :class_name => :user
has_many :public_members, :class_name => :user
def member?(user_login)
- _client.conn.get("/orgs/#{login}/members/#{user_login}").status == 204
+ begin
+ _client.conn.get("/orgs/#{login}/members/#{user_login}").status == 204
+ rescue Githu3::NotFound
+ false
+ end
end
def public_member?(user_login)
- _client.conn.get("/orgs/#{login}/public_members/#{user_login}").status == 204
+ begin
+ _client.conn.get("/orgs/#{login}/public_members/#{user_login}").status == 204
+ rescue Githu3::NotFound
+ false
+ end
end
end
end
\ No newline at end of file