Fix try/catch block for http