Back to Fullcalendar

eventSourceFailure

_docs-v6/event-source/eventSourceFailure.md

latest747 B
Original Source

Called when any of the event sources fails. Probably because an AJAX request failed.

<div class='spec' markdown='1'> function( *errorObj* ) </div>

Receives one argument, an error object, which is guaranteed to have at least a message property (a string).

If the event source was a JSON feed, the error will have a response property, the Response object returned from the underlying request:

js
import { JsonRequestError } from '@fullcalendar/core'

const calendar = new Calendar(el, {
  // ...
  eventSourceFailure(error) {
    if (error instanceof JsonRequestError) {
      console.log(`Request to ${error.response.url} failed`)
    }
  }
  // ...
})