UNPKG

@wristband/nextjs-auth

Version:

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

23 lines (22 loc) 700 B
/** * 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. */ export 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; } }