Sha256: fc9327b57ba48ed6d987c1b3cd36d895525797b2dfd53288d526ad571d659e90

Contents?: true

Size: 615 Bytes

Versions: 2

Compression:

Stored size: 615 Bytes

Contents

import { setDispatchOverride } from 'ember-error-handling';

let adapter;
export function getAdapter() {
  return adapter;
}

export function setAdapter(value) {
  adapter = value;
  if (value && typeof value.exception === 'function') {
    setDispatchOverride(adapterDispatch);
  } else {
    setDispatchOverride(null);
  }
}

export function asyncStart() {
  if (adapter) {
    adapter.asyncStart();
  }
}

export function asyncEnd() {
  if (adapter) {
    adapter.asyncEnd();
  }
}

function adapterDispatch(error) {
  adapter.exception(error);

  console.error(error.stack); // eslint-disable-line no-console
}

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
discourse-ember-source-3.5.1.1 dist/es/ember-testing/lib/test/adapter.js
discourse-ember-source-3.5.1.0 dist/dist/es/ember-testing/lib/test/adapter.js