Skip to content
This repository was archived by the owner on Mar 24, 2023. It is now read-only.
This repository was archived by the owner on Mar 24, 2023. It is now read-only.

How does one loop your expcetions #207

Description

@davidbuckleyni

I have tried to loop your exceptions with no luck Catch ex As MailChimp.Errors.MailChimpAPIException

How does one return the string to be able to display to user also at min I am getting user subscribed to many times error.

I have used the same address a number of times but deleted them from the list should I still be getting above error if removed from list ?

 Try

            If System.Text.RegularExpressions.Regex.IsMatch(txtEmail.Text, "\w+([-+.']\w+)*@\w+([-.]\w+)*\.\w+([-.]\w+)*") = False Then

                lblblerror.Text = "Please enter a valid email address."

            Else

                Dim mailChimp As New MailChimpManager("-us5")
                Dim email As New EmailParameter
                email.Email = txtEmail.Text.Trim()
                mailChimp.Subscribe("", email, doubleOptIn:=False)
                lblVoucher.Text = "Voucher Code is : "
                lblVoucher.Visible = True
                btnNewGetVoucher.Visible = False
                btnDontShow.Visible = False
                'lets create the cookie that will control the page display of popup
                txtEmail.Visible = False


                Session("promotionGiftCode") = ""
                Dim cookie As System.Web.HttpCookie = New HttpCookie("galgormgrouppopup")
                cookie.Value = txtEmail.Text.Trim()
                Session("mailChimpEmail") = txtEmail.Text.ToString()
                cookie.Expires = DateTime.Now.AddDays(7)
                Response.Cookies.Add(cookie)


            End If
        Catch ex As MailChimp.Errors.MailChimpAPIException

            lblblerror.Text = ex.MailChimpAPIError.Error





        End Try

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions