raising errors instead of printing and exiting program