UNPKG

@wristband/nextjs-auth

Version:

SDK for integrating your Next.js application with Wristband. Handles user authentication, session management, and token management.

27 lines (26 loc) 832 B
"use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.FetchError = void 0; /** * Represents an error that occurs during a fetch request. * * Wraps both the raw {@link Response} object and its parsed body, * providing structured access to error details returned by the server. * * @template Response - The type of the underlying fetch response object. */ class FetchError extends Error { /** * Creates a new FetchError instance. * * @param response - The raw fetch Response associated with the error. * @param body - The parsed body of the response, if available. */ constructor(response, body) { super('Fetch Error'); this.name = 'FetchError'; this.response = response; this.body = body; } } exports.FetchError = FetchError;