Download node_modules/@aws-sdk/smithy-client/dist-cjs/default-error-handler.js from sweet2004/bot: direct link, hf CLI and curl.
- Browser
- Download file 1.54 kB
-
https://huggingface.co/spaces/sweet2004/bot/resolve/main/node_modules/%40aws-sdk/smithy-client/dist-cjs/default-error-handler.js
- Command line
-
hf download hf://spaces/sweet2004/bot/node_modules/@aws-sdk/smithy-client/dist-cjs/default-error-handler.js
-
curl -L -o default-error-handler.js https://huggingface.co/spaces/sweet2004/bot/resolve/main/node_modules/%40aws-sdk/smithy-client/dist-cjs/default-error-handler.js
1.54 kB
| ; | |
| Object.defineProperty(exports, "__esModule", { value: true }); | |
| exports.withBaseException = exports.throwDefaultError = void 0; | |
| const exceptions_1 = require("./exceptions"); | |
| const throwDefaultError = ({ output, parsedBody, exceptionCtor, errorCode }) => { | |
| const $metadata = deserializeMetadata(output); | |
| const statusCode = $metadata.httpStatusCode ? $metadata.httpStatusCode + "" : undefined; | |
| const response = new exceptionCtor({ | |
| name: (parsedBody === null || parsedBody === void 0 ? void 0 : parsedBody.code) || (parsedBody === null || parsedBody === void 0 ? void 0 : parsedBody.Code) || errorCode || statusCode || "UnknownError", | |
| $fault: "client", | |
| $metadata, | |
| }); | |
| throw (0, exceptions_1.decorateServiceException)(response, parsedBody); | |
| }; | |
| exports.throwDefaultError = throwDefaultError; | |
| const withBaseException = (ExceptionCtor) => { | |
| return ({ output, parsedBody, errorCode }) => { | |
| (0, exports.throwDefaultError)({ output, parsedBody, exceptionCtor: ExceptionCtor, errorCode }); | |
| }; | |
| }; | |
| exports.withBaseException = withBaseException; | |
| const deserializeMetadata = (output) => { | |
| var _a, _b; | |
| return ({ | |
| httpStatusCode: output.statusCode, | |
| requestId: (_b = (_a = output.headers["x-amzn-requestid"]) !== null && _a !== void 0 ? _a : output.headers["x-amzn-request-id"]) !== null && _b !== void 0 ? _b : output.headers["x-amz-request-id"], | |
| extendedRequestId: output.headers["x-amz-id-2"], | |
| cfId: output.headers["x-amz-cf-id"], | |
| }); | |
| }; | |