interface FetcherEventMap {
    error: {
        error: Error;
    };
}

Properties

Properties

error: {
    error: Error;
}

Fires when a Network or HTTP error occured during fetch

Fetcher.addEventListener('error', (error) => {
if (error.response && error.response.status === 401) {
console.error(
`Unauthorized to access resource ${error.response.url}: ${error.message}`,
error,
);
} else {
console.error('Got an error while fetching resource', error);
}
});