add test for http error, fix incorrect error reporting