Compare commits

..

2 Commits

Author SHA1 Message Date
SukkaW
b46ff52e1c Update CDN Hosts
Some checks failed
Build / Build (push) Has been cancelled
Build / Diff output (push) Has been cancelled
Build / Deploy to Cloudflare Pages (3.114.12) (push) Has been cancelled
Build / Deploy to GitHub and GitLab (push) Has been cancelled
Build / Remove Artifacts after Deployment (push) Has been cancelled
2025-11-22 14:15:43 +08:00
SukkaW
9bc40a80b5 Chore: minor changes 2025-11-20 22:23:42 +08:00
3 changed files with 10 additions and 21 deletions

View File

@ -8,14 +8,9 @@ import { AdGuardFilterIgnoreUnsupportedLinesStream } from './parse-filter/filter
import { appendArrayInPlace } from 'foxts/append-array-in-place';
import { newQueue } from '@henrygd/queue';
import { AbortError } from 'foxts/abort-error';
// eslint-disable-next-line sukka/unicorn/custom-error-definition -- typescript is better
class CustomAbortError extends Error {
public readonly name = 'AbortError';
public readonly digest = 'AbortError';
}
const reusedCustomAbortError = new CustomAbortError();
const reusedCustomAbortError = new AbortError();
const queue = newQueue(16);

View File

@ -18,6 +18,7 @@ import { inspect } from 'node:util';
import path from 'node:path';
import fs from 'node:fs';
import { CACHE_DIR } from '../constants/dir';
import { isAbortErrorLike } from 'foxts/abort-error';
if (!fs.existsSync(CACHE_DIR)) {
fs.mkdirSync(CACHE_DIR, { recursive: true });
@ -166,13 +167,8 @@ export async function $$fetch(url: string, init: RequestInit = defaultRequestIni
return res;
} catch (err: unknown) {
if (typeof err === 'object' && err !== null && 'name' in err) {
if ((
err.name === 'AbortError'
|| ('digest' in err && err.digest === 'AbortError')
)) {
console.log(picocolors.gray('[fetch abort]'), url);
}
if (isAbortErrorLike(err)) {
console.log(picocolors.gray('[fetch abort]'), url);
} else {
console.log(picocolors.gray('[fetch fail]'), url, { name: (err as any).name }, err);
}
@ -195,13 +191,8 @@ export async function requestWithLog(url: string, opt?: Parameters<typeof undici
return res;
} catch (err: unknown) {
if (typeof err === 'object' && err !== null && 'name' in err) {
if ((
err.name === 'AbortError'
|| ('digest' in err && err.digest === 'AbortError')
)) {
console.log(picocolors.gray('[fetch abort]'), url);
}
if (isAbortErrorLike(err)) {
console.log(picocolors.gray('[fetch abort]'), url);
} else {
console.log(picocolors.gray('[fetch fail]'), url, { name: (err as any).name }, err);
}

View File

@ -5101,3 +5101,6 @@ static.underhentai.net
covers.openlibrary.org
cdn.nodeimage.com
.digikeyassets.com
.storage.boilerplate.com
api-cdn.shutterstock.com
server.arcgisonline.com