Mini Shell

Direktori : /opt/alt/alt-nodejs19/root/usr/lib/node_modules/npm/node_modules/sigstore/dist/client/
Upload File :
Current File : //opt/alt/alt-nodejs19/root/usr/lib/node_modules/npm/node_modules/sigstore/dist/client/error.js

"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;

Zerion Mini Shell 1.0