altered format exception to log a message if not passed a custom error message