catches stream exception
Merge pull request #172 from schaeferd/catch-stream-exception

catches stream exception