ratiw / vuetable-2-tutorial

MIT License
258 stars 67 forks source link

How to capture the failed API response in vuetable-2? #62

Open infotokabil opened 6 years ago

infotokabil commented 6 years ago

Hi,

I am calling one API endpoint to get the data and in some scenarios that particular API endpoint may not be available or it may return the GatewayTimeout error as the response.

How to capture this error response?

Regards, Kabilan S

ratiw commented 6 years ago

You can listen to vuetable:load-error event.

<template>
  <vuetable 
    @vuetable:load-error="handleLoadError"
  ></vuetable>
</template>
<script>
  //...
  methods: {
    handleLoadError(response) {
      //...
    }
  }
</script>