wpt-api-client
Version:
Unofficial Node.js client for the WebPageTest REST API
15 lines • 681 B
JavaScript
;
Object.defineProperty(exports, "__esModule", { value: true });
exports.configurationErrorMessage = exports.throwIfNotSuccess = void 0;
const FALLBACK_MESSAGE = 'WPT did not return a HTTP 200 but defined no statusText';
const throwIfNotSuccess = (body) => {
if (body.statusCode !== 200) {
throw new Error(body.statusText || FALLBACK_MESSAGE);
}
};
exports.throwIfNotSuccess = throwIfNotSuccess;
const configurationErrorMessage = () => {
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