kr / hk

Fast Heroku client
https://hk.heroku.com/
77 stars 6 forks source link

Ugly 404 error when trying to scale an undefined process type #82

Open bgentry opened 10 years ago

bgentry commented 10 years ago
$ hk -a myapp-staging scale r53_update=0
Unexpected error: 404 Not Found

Compare to the ruby CLI, which tells you exactly what the problem is:

$ heroku scale -a myapp-staging r53_update=0
Scaling r53_update dynos... failed
 !    No such process type r53_update defined in Procfile.

Not sure if we have to guess at the meaning of the 404 or if there's a better error returned by the API. Will need to dig into that.

brandur commented 10 years ago

We could probably move that error message to the server as it might be generally helpful for people developing API consumers. Either that, or you could look for the particular error ID (I think formation_not_found here probably?) and just translate it to what's shown by the current CLI.

On Mon, Oct 14, 2013 at 09:49:48AM -0700, Blake Gentry wrote:

$ hk -a myapp-staging scale r53_update=0
Unexpected error: 404 Not Found

Compare to the ruby CLI, which tells you exactly what the problem is:

$ heroku scale -a myapp-staging r53_update=0
Scaling r53_update dynos... failed
 !    No such process type r53_update defined in Procfile.

Not sure if we have to guess at the meaning of the 404 or if there's a better error returned by the API. Will need to dig into that.


Reply to this email directly or view it on GitHub: https://github.com/kr/hk/issues/82

kr commented 10 years ago

Thanks for the help @brandur, having hk read the error ID should be fine. No need to change this on our account, though of course if you want to do it in general, that's awesome.

In addition to specific error IDs, hk should also do a better job of rendering any human-readable error message that's returned by the api, instead of just bailing out when we get a non 2xx response code.