restish
restish copied to clipboard
Reliably set the exist status code on errors
Currently there are cases where an error correctly sets a status code <> 0 (e.g. on authentication failures) but other cases (e.g. host not reachable, HTTP 400/500) exit with success, making it hard to use in scripts. I'd propose to always set an error code on hard errors (e.g. communication failures) and provide an option (similar to curl) to exit with an error status if the HTTP status code responds with an error (4xx/5xx).