Error handling in curl protocol
Exception generalization
Refactoring