Adds a conditional check for email errors