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 / refusal / refusal.ts
15 lines · 542 BRaw
1import type { Method } from '../method'
2
3/**
4 * The error a refused entry rejects with, naming the method and what was wrong.
5 *
6 * The text carries a key that passed TOKEN or a status code, nothing the caller
7 * wrote as free text.
8 *
9 * @param what the refusal, as the caller reads it
10 * @param method the method refusing
11 * @returns the error to reject the call with, naming the method and what was
12 * wrong
13 */
14export const refusal = (what: string, method: Method = 'log'): Error =>
15 new Error(`$.telemetry.${method}: ${what}`)