UNPKG

@foxy.io/sdk

Version:

Universal SDK for a full server-side and a limited in-browser access to Foxy hAPI.

20 lines (19 loc) 621 B
import { Response } from 'cross-fetch'; import v8n from 'v8n'; /** * This error is thrown when one of the requests for a resource * in a path returns a non-2XX status code during the URL resolution process. * If you're implementing a custom resolver, consider using this class * to indicate resolution errors. */ export class ResolutionError extends Error { constructor(response) { super(); ResolutionError.v8n.constructor.check(response); this.response = response; } } /** Available class member validators. */ ResolutionError.v8n = { constructor: v8n().instanceOf(Response), };