How to use the @pollyjs/utils.PollyError function in @pollyjs/utils

To help you get started, we’ve selected a few @pollyjs/utils examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github Netflix / pollyjs / packages / @pollyjs / adapter / src / index.js View on Github external
async onRequestFailed(pollyRequest, error) {
    error = error || new PollyError('Request failed due to an unknown error.');

    try {
      await pollyRequest._emit('error', error);
      await this.respondToRequest(pollyRequest, error);
    } catch (e) {
      // Rethrow any error not handled by `respondToRequest`.
      throw e;
    } finally {
      pollyRequest.promise.reject(error);
    }
  }
}
github Netflix / pollyjs / packages / @pollyjs / core / src / test-helpers / lib.js View on Github external
get() {
      throw new PollyError(
        `You are trying to access an instance of Polly that is no longer available.\n` +
          `See: https://netflix.github.io/pollyjs/#/test-frameworks/${framework}?id=test-hook-ordering`
      );
    }
  });