More elegant error logging and method exit