Permalink
Browse files

Added a clause for GitHub's 403 status code (normally used when API r…

…ate limit is exceeded). There's nothing we can do about this at the moment. I tried lifting this limit for agner, but no luck.
  • Loading branch information...
1 parent a7be1ac commit 4877e6319ee1dc957bb273816538e04789a5454a @yrashk yrashk committed Jan 27, 2011
Showing with 3 additions and 2 deletions.
  1. +3 −2 src/agner_github.erl
View
5 src/agner_github.erl
@@ -136,8 +136,9 @@ httpc_request_1(URL, Opts) ->
parse_response({ok, {{"HTTP/1.1",200,_},_Headers,Body}}) ->
mochijson2:decode(Body);
parse_response({ok, {{"HTTP/1.1",404,_},_Headers,_Body}}) ->
- {error, not_found}.
-
+ {error, not_found};
+parse_response({ok, {{"HTTP/1.1",403,_}, _Headers, _Body}}) ->
+ {error, github_rate_limit_exceeded}.
%%%
repo_name(B) when is_binary(B) ->

0 comments on commit 4877e63

Please sign in to comment.