Print error if thrown when closing inputstream