exception handling - print error messages via output