fix logger variable name
remove duplicate require
call callback on connection error
Merge pull request #17 from matiu/bug/callback-on-rpc-error

Bug/callback on rpc error