refactor (exception) : Handle exception for HTTP requests