spacehub

surshar / claude-code

Claude Code is an agentic coding tool that lives in your terminal, understands your codebase, and helps you code faster by executing routine tasks, explaining complex code, and handling git workflows - all through natural language commands.

Built by Anthropic · github.com/anthropics

claude-code / mods / telemetry / hooks / entries / is-refused-entry / is-refused-entry.ts
11 lines · 449 BRaw
1import type { RefusedEntry } from '../refused-entry'
2
3/**
4 * Whether an error is an entry's refusal (`refusal`), and so carries the
5 * reason to deny with, rather than something that went wrong on the way.
6 *
7 * @param error what a check threw
8 * @returns whether it is a refused entry's error
9 */
10export const isRefusedEntry = (error: unknown): error is RefusedEntry =>
11 error instanceof Error && 'what' in error && typeof error.what === 'string'