added .error method to add information to errors/make flexible error handling.