Log before throwing exception.