http: implement proper error semantics