rubik / stack-hpc-coveralls

Coveralls support for Stack projects
ISC License
33 stars 15 forks source link

Improve HTTP status code errors #14

Closed hdgarrood closed 8 years ago

hdgarrood commented 8 years ago

Before:

shc: StatusCodeException (Status {statusCode = 422, statusMessage = "Unprocessable Entity"}) [("Date","Sun, 08 May 2016 17:05:28 GMT"),("Content-Type","application/json; charset=utf-8"),("Transfer-Encoding","chunked"),("Connection","keep-alive"),("Set-Cookie","__cfduid=dd7ed40fc1eb00e3cf109da0cf18e1e001462727127; expires=Mon, 08-May-17 17:05:27 GMT; path=/; domain=.coveralls.io; HttpOnly"),("Cache-Control","no-cache"),("Set-Cookie","request_method=POST; path=/"),("Status","422 Unprocessable Entity"),("X-Content-Type-Options","nosniff"),("X-Frame-Options","SAMEORIGIN"),("X-Powered-By","Phusion Passenger Enterprise 5.0.23"),("X-Request-Id","890c664f-048a-4b86-9b43-51e73241a2e3"),("X-Runtime","0.190930"),("X-UA-Compatible","chrome=1"),("X-XSS-Protection","1; mode=block"),("Server","cloudflare-nginx"),("CF-RAY","29fe7f234bce2531-ORD"),("X-Response-Body-Start","{\"message\":\"Couldn't find a repository matching this job.\",\"error\":true}"),("X-Request-URL","POST https://coveralls.io:443/api/v1/jobs")] (CJ {expose = [Cookie {cookie_name = "request_method", cookie_value = "POST", cookie_expiry_time = 3015-09-09 00:00:00 UTC, cookie_domain = "coveralls.io", cookie_path = "/", cookie_creation_time = 2016-05-08 17:05:28.367057 UTC, cookie_last_access_time = 2016-05-08 17:05:28.367057 UTC, cookie_persistent = False, cookie_host_only = True, cookie_secure_only = False, cookie_http_only = False},Cookie {cookie_name = "__cfduid", cookie_value = "dd7ed40fc1eb00e3cf109da0cf18e1e001462727127", cookie_expiry_time = 2017-05-08 17:05:27 UTC, cookie_domain = "coveralls.io", cookie_path = "/", cookie_creation_time = 2016-05-08 17:05:28.367057 UTC, cookie_last_access_time = 2016-05-08 17:05:28.367057 UTC, cookie_persistent = True, cookie_host_only = False, cookie_secure_only = False, cookie_http_only = True}]})

After:

Error: Coveralls returned HTTP 422 Unprocessable Entity
{"message":"Couldn't find a repository matching this job.","error":true}
hdgarrood commented 8 years ago

Also, in case you were wondering, I think the above error is caused by a configuration error, like an API key missing. I'm a bit sad it doesn't return 401 Unauthorized here; oh well.

coveralls commented 8 years ago

Coverage Status

Coverage remained the same at 41.667% when pulling 5a672307d76f29b7e25513cbb9e9a008ed2061f2 on hdgarrood:better-http-errors into d1361d462761dafdb52e397ebf708b180969eff0 on rubik:master.

rubik commented 8 years ago

Oh, much better! Thanks a lot for the PR!

hdgarrood commented 8 years ago

Thank you for stack-hpc-coveralls :)