@supabase/postgrest-js 3.0.0-next.16 → 3.0.0-next.18

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
@@ -51,6 +51,12 @@ var PostgrestError = class extends Error {
51
51
  */
52
52
  constructor(context) {
53
53
  super(context.message);
54
+ Object.defineProperty(this, "message", {
55
+ value: context.message,
56
+ enumerable: true,
57
+ writable: true,
58
+ configurable: true
59
+ });
54
60
  this.name = "PostgrestError";
55
61
  this.details = context.details;
56
62
  this.hint = context.hint;
@@ -266,7 +272,7 @@ var PostgrestBuilder = class {
266
272
  signal: _this.signal
267
273
  });
268
274
  } catch (fetchError) {
269
- if ((fetchError === null || fetchError === void 0 ? void 0 : fetchError.name) === "AbortError" || (fetchError === null || fetchError === void 0 ? void 0 : fetchError.code) === "ABORT_ERR") throw fetchError;
275
+ if (fetchError instanceof Error && (fetchError.name === "AbortError" || "code" in fetchError && fetchError.code === "ABORT_ERR")) throw fetchError;
270
276
  if (!RETRYABLE_METHODS.includes(_this.method)) throw fetchError;
271
277
  if (_this.retryEnabled && attemptCount < DEFAULT_MAX_RETRIES) {
272
278
  const delay = getRetryDelay(attemptCount);
@@ -388,7 +394,7 @@ var PostgrestBuilder = class {
388
394
  }
389
395
  return {
390
396
  success: error === null,
391
- error,
397
+ error: error ? new PostgrestError(error) : null,
392
398
  data,
393
399
  count,
394
400
  status,