UNPKG

wpt-api-client

Version:

Unofficial Node.js client for the WebPageTest REST API

15 lines 687 B
"use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.configurationErrorMessage = exports.throwIfNotSuccess = void 0; var FALLBACK_MESSAGE = 'WPT did not return a HTTP 200 but defined no statusText'; var throwIfNotSuccess = function (body) { if (body.statusCode !== 200) { throw new Error(body.statusText || FALLBACK_MESSAGE); } }; exports.throwIfNotSuccess = throwIfNotSuccess; var configurationErrorMessage = function () { return "You must provide wptServer if you don't have/need an apiKey (you have a private WebPageTest instance)"; }; exports.configurationErrorMessage = configurationErrorMessage; //# sourceMappingURL=error.js.map