Iostreams can be any of three different failure states: fail, bad, and eof. The documentation shows you clearly how to cause any one of those to throw an exception; by default, none of them do, but evaluating a stream object in a boolean context returns false
if any of the failure modes have occured.
Example:
#include <fstream>
std::ifstream infile;
infile.expections(std::ios::failbit);
infile.open("foo.txt"); // throws on failure