restish icon indicating copy to clipboard operation
restish copied to clipboard

Reliably set the exist status code on errors

Open ahochsteger opened this issue 3 years ago • 0 comments

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).

ahochsteger avatar Jun 09 '22 09:06 ahochsteger