Skip to main content
Best answer

How to handle Zapier authentiation failure propertly?

  • February 13, 2020
  • 4 replies
  • 1595 views

khakman

Screen Shot 2020-02-13 at 14.55.50.pngI'm trying to display a friendly message on the authentication failure prompt in Zapier. Throwing an Error or HaltedError is always showing the stack trace and the console logs which I'd like to get rid of. Is there a way to only display a custom message we specify?


Best answer by DanversBest answer by Danvers

You might find it easier to create a new Zapier account to test with and ask the owner of the app to invite that account. That way you don't have to keep adding then removing your regular account as a developer on the app.


View original
Did this topic help you find an answer to your question?
This post has been closed for comments. Please create a new post if you need help or have a question about this topic.

4 replies

BowTieBots
Forum|alt.badge.img+4
  • Zapier Expert
  • 82 replies
  • February 13, 2020

Make sure you test the message on an account that does not have Developer access to the app. Zapier checks the logged in user's credentials and provides additional information if your account has developer access.


What code are you currently trying to use to display the "friendly message"?



ikbelkirasan
Forum|alt.badge.img+12
  • Zapier Expert
  • 555 replies
  • February 13, 2020

You can always catch the error in a try-catch block and remove the stack trace then throw it again. For example:

try {

// your code

} catch (error) {

error.stack = "\n"; // This should remove any stack trace from the error that is shown in the UI

throw error;

}




khakman
  • Author
  • Beginner
  • 8 replies
  • February 14, 2020

I'm using afterResponse where I'm validating the response status and throwing a HaltedError


if (response.status === 403) {

throw new z.errors.HaltedError('Help message here...');

}


This app is not promoted yet. I have shared access to this app by invitation and the account invited gets to see the same "What happened.. " and "Console logs: " messages. Can I remove developer access to an account invited?





Danvers
Forum|alt.badge.img+12
  • Zapier Staff
  • 3731 replies
  • Answer
  • February 14, 2020

You might find it easier to create a new Zapier account to test with and ask the owner of the app to invite that account. That way you don't have to keep adding then removing your regular account as a developer on the app.