Printing exception if one occurs