Class TimeoutError
Extends: | AdapterError |
---|---|
Defined in: | ../adapter/addon/error.js:183 |
Module: | @ember-data/adapter |
A TimeoutError
is used by an adapter to signal that a request to the external API has timed out. I.e. no response was received from the external API within an allowed time period.
An example use case would be to warn the user to check their internet connection if an adapter operation has timed out:
app/routes/application.js
import Route from '@ember/routing/route'; import { TimeoutError } from '@ember-data/adapter/error'; import { action } from '@ember/object'; export default class ApplicationRoute extends Route { @action error(error, transition) { if (error instanceof TimeoutError) { // alert the user alert('Are you still connected to the Internet?'); return; } // ...other error handling logic } }
© 2020 Yehuda Katz, Tom Dale and Ember.js contributors
Licensed under the MIT License.
https://api.emberjs.com/ember-data/3.25/classes/TimeoutError