Skip to content

Documentation / @ember-data/adapter / error / TimeoutError

Defined in: packages/adapter/src/error.js:211

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
js
import { TimeoutError } from '@ember-data/adapter/error';

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
  }
}

TimeoutError

ts
class TimeoutError(errors, message): void;

Defined in: packages/adapter/src/error.js:211

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
js
import { TimeoutError } from '@ember-data/adapter/error';

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
  }
}

TimeoutError

Parameters

errors

any

message

any

Returns

void

Properties

extend()

ts
static extend: (__namedParameters) => {
(errors, message): void;
  extend: ({ message: defaultMessage }?: {}) => { (errors: any, message: any): void; prototype: any; extend: ...; };
  prototype: any;
};

Defined in: packages/adapter/src/error.js:112

Parameters

__namedParameters

Returns

ts
(errors, message): void;
Parameters
errors

any

message

any

Returns

void

extend
ts
extend: ({ message: defaultMessage }?: {}) => { (errors: any, message: any): void; prototype: any; extend: ...; };
prototype
ts
prototype: any;

Released under the MIT License.