rescue and log net-http errors, example changed a bit