Sha256: df25fbbcba12fa80c240846ccc35b9515b605ef19e44579e8b15622108312e9e
Contents?: true
Size: 631 Bytes
Versions: 33
Compression:
Stored size: 631 Bytes
Contents
"use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.checkStatus = exports.HTTPError = void 0; class HTTPError extends Error { constructor(response) { super(`HTTP Error: ${response.status} ${response.statusText}`); this.response = response; this.statusCode = response.status; this.location = response.headers?.get('Location') || undefined; } } exports.HTTPError = HTTPError; const checkStatus = (response) => { if (response.ok) { return response; } else { throw new HTTPError(response); } }; exports.checkStatus = checkStatus;
Version data entries
33 entries across 33 versions & 1 rubygems