catch curl exception
Merge pull request #2 from pfchen/fix-bug

catch curl exception