Correctly handle exceptions in http-helpers