Correct https error handling (only return as normal for http
status==200, all other values call $error)