Title: Changing error message &#8211; checking if API answer is empty
Last modified: February 23, 2020

---

# Changing error message – checking if API answer is empty

 *  [symergo](https://wordpress.org/support/users/symergo/)
 * (@symergo)
 * [6 years, 2 months ago](https://wordpress.org/support/topic/changing-error-message-checking-if-api-answer-is-empty/)
 * Hi,
 * What would be the best way to test if a search through the php function AmazonAutoLinks
   returns an error? (for example, no products found?)
 * Example: following might return “Amazon Auto Links: PAAPIError: NoResults: No
   results found for your request.” I would like to customize the error message.
 * <?php AmazonAutoLinks( array( ‘search’ => ‘xxxxxxx’ ) ); ?>
 * Thanks.

Viewing 4 replies - 1 through 4 (of 4 total)

 *  Plugin Author [miunosoft](https://wordpress.org/support/users/miunosoft/)
 * (@miunosoft)
 * [6 years, 2 months ago](https://wordpress.org/support/topic/changing-error-message-checking-if-api-answer-is-empty/#post-12471273)
 * Hi,
 * At the moment, there is no way to customize error messages. Sorry. They need 
   to be untouched for when users report problems so that the developer can know
   what kind of problem they are. If the error message is modified, the developer
   has too little clue what’s going on.
 * Maybe you can explain why you need this in more detail so that we can find another
   approach.
 * Thank you.
 *  Plugin Author [miunosoft](https://wordpress.org/support/users/miunosoft/)
 * (@miunosoft)
 * [6 years, 2 months ago](https://wordpress.org/support/topic/changing-error-message-checking-if-api-answer-is-empty/#post-12536084)
 * The development version [v4.1.0b](https://downloads.wordpress.org/plugin/amazon-auto-links.zip)
   comes with a new unit option named `Show Errors` under the `Common Advanced` 
   section. This lets you hide errors.
 * Let me know if this solves your issue.
 *  Thread Starter [symergo](https://wordpress.org/support/users/symergo/)
 * (@symergo)
 * [6 years, 2 months ago](https://wordpress.org/support/topic/changing-error-message-checking-if-api-answer-is-empty/#post-12543876)
 * Hi Miunosoft,
    That indeed helps a lot! My main concern was the cryptic error
   messages that I would like to replace with a more general message. Hiding the
   error entirely definitively helps as well. Thanks.
 * fyi: Amazon . nl is live as well now, you might want to add it.
 *  Plugin Author [miunosoft](https://wordpress.org/support/users/miunosoft/)
 * (@miunosoft)
 * [6 years, 2 months ago](https://wordpress.org/support/topic/changing-error-message-checking-if-api-answer-is-empty/#post-12545111)
 * Glad it helped!
 * Thanks for the heads up about the `.nl` locale.

Viewing 4 replies - 1 through 4 (of 4 total)

The topic ‘Changing error message – checking if API answer is empty’ is closed to
new replies.

 * ![](https://s.w.org/plugins/geopattern-icon/amazon-auto-links_eeeeee.svg)
 * [Auto Amazon Links - Amazon Associates Affiliate Plugin](https://wordpress.org/plugins/amazon-auto-links/)
 * [Frequently Asked Questions](https://wordpress.org/plugins/amazon-auto-links/#faq)
 * [Support Threads](https://wordpress.org/support/plugin/amazon-auto-links/)
 * [Active Topics](https://wordpress.org/support/plugin/amazon-auto-links/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/amazon-auto-links/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/amazon-auto-links/reviews/)

## Tags

 * [amazon](https://wordpress.org/support/topic-tag/amazon/)
 * [amazon affiliates](https://wordpress.org/support/topic-tag/amazon-affiliates/)
 * [amazon associates](https://wordpress.org/support/topic-tag/amazon-associates/)
 * [customization](https://wordpress.org/support/topic-tag/customization/)
 * [errors](https://wordpress.org/support/topic-tag/errors/)

 * 4 replies
 * 2 participants
 * Last reply from: [miunosoft](https://wordpress.org/support/users/miunosoft/)
 * Last activity: [6 years, 2 months ago](https://wordpress.org/support/topic/changing-error-message-checking-if-api-answer-is-empty/#post-12545111)
 * Status: not resolved