Buddi SEO Documentation
Home
Return to Buddi.io
Home
Return to Buddi.io
  • Getting Started

    • Installation Guide
  • Functions

    • Store Selection
    • Single Product
    • All Products
    • Products by Category
    • Products by Categories
    • Featured Promotions
    • Collections
    • Store Info
    • Add to Cart
    • Content Management System
  • Modules

    • Shopping Cart Module
    • Customer Profile
  • Advanced Functions

    • Dynamic object syncing
    • Cart
    • Customer
    • Login Customer
    • Logout Customer
    • Register Customer
    • Update Customer
  • Events
  • FAQ
  • Exceptions Handling
  • Caching
  • Deploying
  • Example Templates

Exceptions handling

Sometimes an exception can occur within a method call. It can happen for a number of reasons. In any case you need to handle these exceptions on your own.

For your convenience if it’s an HTTP exception we modify and throw it in the following format:

{
    status: {status},	//Response status from the server
    json: {...}		//JSON detals from the server
}

An example: you haven’t passed storeId into the setUp method and now is trying to pull the products (don’t do this!).

{
    Buddi.setUp({});
     
    Buddi.getProducts().catch(error => {
      console.error(error);
    });
}

You’ll see the exception in your console

Moreover Buddi throws an event every time when an API call returns not a 2xx response. The specific events which Buddi throws will be described below

Last Updated: 10/6/25, 10:32 PM
Contributors: jesseleejohnston
Prev
FAQ
Next
Caching