Skip to content

Commit

Permalink
refactor: Deno.errors.TimedOutky.TimeoutError
Browse files Browse the repository at this point in the history
  • Loading branch information
YDX-2147483647 committed Dec 12, 2023
1 parent 90286e6 commit 89fd771
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions src/plugin/cli/hooks.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
import { TimeoutError } from 'ky'
import cliProgress from 'npm:cli-progress'

import type { HookCollectionType } from '../../core/index.ts'
import { logger } from '../../util/logger.ts'
import { recent_checker } from '../../util/my_date.ts'
Expand All @@ -19,9 +21,9 @@ export function verbose(hook: HookCollectionType) {
logger.warn(`未能访问“${source.name}”(NotFound)。将忽略。`, {
plugin: 'cli',
})
} else if (err instanceof Deno.errors.TimedOut) {
} else if (err instanceof TimeoutError) {
logger.error(
`访问“${source.name}”(TimedOut)超时,可能因为访问太频繁。将忽略。`,
`访问“${source.name}”(Timeout)超时,可能因为访问太频繁。将忽略。`,
{ plugin: 'cli' },
)
} else {
Expand Down

0 comments on commit 89fd771

Please sign in to comment.