I am using cardmagic/contacts gem to import contacts from email addresses in my application. It is working fine but my problem is I want to catch the authentication error like wrong username/password for following code.
@contacts = Contacts.guess(@username, @password)
I want to display that error to user.
I have tried this but not working for me.
@contacts = Contacts.guess(@username, @password) rescue Contacts::AuthenticationError
So please guide me how to do so.
Thank you.
new.html.erb: