UNPKG

@stellar/stellar-sdk

Version:

A library for working with the Stellar network, including communication with the Horizon and Soroban RPC servers.

21 lines (18 loc) 533 B
'use strict'; function wrapHttpError(error, wrap) { const response = error?.response ?? error; if (response && typeof response.status === "number") { const wrapped = wrap({ data: response.data, status: response.status, statusText: response.statusText }); if (error instanceof Error) { wrapped.cause = error; } return wrapped; } return error instanceof Error ? error : new Error(String(error)); } exports.wrapHttpError = wrapHttpError; //# sourceMappingURL=wrap_http_error.js.map