Improving error handling in CLI with respect to HTTP status codes