JuliaWeb / GitHub.jl

A Julia package for interfacing with GitHub
MIT License
172 stars 60 forks source link

Handle GitHub redirections? #29

Open jiahao opened 9 years ago

jiahao commented 9 years ago
julia> contributors("dlfivefifty", "ApproxFun.jl")

HttpError(404,"Not Found","https://developer.github.com/v3")
while loading In[42], in expression starting on line 103

 in handle_error at /Users/jiahao/.julia/v0.3/GitHub/src/error.jl:36
 in get_pages at /Users/jiahao/.julia/v0.3/GitHub/src/utils.jl:78
 in get_pages at /Users/jiahao/.julia/v0.3/GitHub/src/utils.jl:77
 in contributors at /Users/jiahao/.julia/v0.3/GitHub/src/repos.jl:132
 in contributors at /Users/jiahao/.julia/v0.3/GitHub/src/repos.jl:120

This particular package was moved to https://github.com/ApproxFun/ApproxFun.jl.

WestleyArgentum commented 9 years ago

Oh, interesting, it shouldn't return a 404 if it wants to redirect... I'll have to poke at this

WestleyArgentum commented 9 years ago

Just an update, I looked at the data being returned from this call, unfortunately it's just a 404 with ["message"=>"Not Found","documentation_url"=>"https://developer.github.com/v3"]... no nice redirect links or anything.

Not quite sure the best way around this. Possibly we could make a second request to regular github (as opposed to the api) and detect a redirect, but that does introduce overhead and sounds like it could be brittle.