UNPKG

@capgo/cli

Version:
12 lines (11 loc) 696 B
export type CliErrorCategory = 'network_error' | 'timeout' | 'unauthorized' | 'forbidden' | 'not_found' | 'payload_too_large' | 'rate_limited' | 'validation_error' | 'server_error' | 'commander' | 'unknown'; /** * Maps an arbitrary thrown value to a closed enum so telemetry never leaks * error text, paths, or user input. Returns 'unknown' for anything unmatched. */ export declare function categorizeCliError(error: unknown): CliErrorCategory; /** * Maps a non-2xx HTTP status to the same closed enum, for Supabase responses * where we have a status code but no thrown Error. Never leaks response bodies. */ export declare function categorizeHttpStatus(status: number): CliErrorCategory;