Custom error class for fetch-related errors. Extends the base Error class with HTTP status code and original error tracking.
throw new FetchError('Request failed', 404); Copy
throw new FetchError('Request failed', 404);
Creates a new FetchError.
Error message describing what went wrong
Optional
HTTP status code (if applicable)
Original error that caused this error (if any)
Custom error class for fetch-related errors. Extends the base Error class with HTTP status code and original error tracking.
Example