Correctly handle IOExceptions wrapped by Ribbon.

reported by Daniel Wong cc @allenxwang