@calimero-network/mero-js 21.1.0 → 21.2.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.cjs CHANGED
@@ -158,7 +158,7 @@ function extractErrorMessage(bodyText) {
158
158
  }
159
159
  var HTTPError = class extends Error {
160
160
  constructor(status, statusText, url, headers, bodyText) {
161
- const explanation = extractErrorMessage(bodyText);
161
+ const explanation = extractErrorMessage(bodyText) ?? (status === 0 && bodyText?.trim() ? bodyText.trim() : void 0);
162
162
  super(
163
163
  explanation ? `HTTP ${status} ${statusText}: ${explanation}` : `HTTP ${status} ${statusText}`
164
164
  );