Fix: connection error handling
Merge pull request #202 from anshul/master

Raise the error if it occurs before datum[:stack] gets set