Skip to main content
Best answer

How can I custom error for user


Marille

How can I change this word such as ‘My app returned “Custom Invalid param”’?

Thank you.

Best answer by MarilleBest answer by Marille

Fixed it.

return z.request(options)
  .then((response) => {

    // 
  }).catch((err) => {
    //let get_error = JSON.parse(err.message);
    //let content = JSON.parse(get_error.content);
    throw new z.errors.Error(‘My app returned “Custom Invalid param”’);
  })

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.

2 replies

Marille
  • Author
  • Beginner
  • 1 reply
  • Answer
  • May 17, 2023

Fixed it.

return z.request(options)
  .then((response) => {

    // 
  }).catch((err) => {
    //let get_error = JSON.parse(err.message);
    //let content = JSON.parse(get_error.content);
    throw new z.errors.Error(‘My app returned “Custom Invalid param”’);
  })


Forum|alt.badge.img+9
  • Zapier Staff
  • 238 replies
  • May 17, 2023

Hey @Marille 👋

Great work and thanks for sharing with the Community! 

All the available error classes to throw in your code, along with examples, are described here: https://github.com/zapier/zapier-platform/blob/main/packages/cli/README.md#zerrors