Const
Error name for timed out fetch requests.
This is set on the Error.name property when a request exceeds the specified timeout duration and is automatically aborted.
Error.name
timeout
import { fetchT, TIMEOUT_ERROR } from '@happy-ts/fetch-t';const result = await fetchT('https://api.example.com/slow-endpoint', { timeout: 5000, // 5 seconds});result.inspectErr((err) => { if (err.name === TIMEOUT_ERROR) { console.log('Request timed out after 5 seconds'); }}); Copy
import { fetchT, TIMEOUT_ERROR } from '@happy-ts/fetch-t';const result = await fetchT('https://api.example.com/slow-endpoint', { timeout: 5000, // 5 seconds});result.inspectErr((err) => { if (err.name === TIMEOUT_ERROR) { console.log('Request timed out after 5 seconds'); }});
Error name for timed out fetch requests.
This is set on the
Error.nameproperty when a request exceeds the specifiedtimeoutduration and is automatically aborted.