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

How does one loop your expcetions #207

Open
davidbuckleyni opened this issue Aug 11, 2017 · 0 comments
Open

How does one loop your expcetions #207

davidbuckleyni opened this issue Aug 11, 2017 · 0 comments
Labels

Comments

@davidbuckleyni
Copy link

davidbuckleyni commented Aug 11, 2017

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
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Projects
None yet
Development

No branches or pull requests

2 participants