Class NotFoundError


A NotFoundError equates to a HTTP 404 Not Found response status. It is used by an adapter to signal that a request to the external API was rejected because the resource could not be found on the API.

An example use case would be to detect if the user has entered a route for a specific model that does not exist. For example:

import { NotFoundError } from '@ember-data/adapter/error';

export default class PostRoute extends Route {
  @service store;
  model(params) {
    return'post', params.post_id);
  error(error, transition) {
    if (error instanceof NotFoundError) {
      // redirect to a list of all posts instead
    } else {
      // otherwise let the error bubble
      return true;