Catching exceptions and outputting them to the stderr.