MCPcopy
hub / github.com/codeaashu/claude-code / getErrorType

Function getErrorType

src/components/NativeAutoUpdater.tsx:19–42  ·  view source on GitHub ↗

* Categorize error messages for analytics

(errorMessage: string)

Source from the content-addressed store, hash-verified

17 * Categorize error messages for analytics
18 */
19function getErrorType(errorMessage: string): string {
20 if (errorMessage.includes('timeout')) {
21 return 'timeout';
22 }
23 if (errorMessage.includes('Checksum mismatch')) {
24 return 'checksum_mismatch';
25 }
26 if (errorMessage.includes('ENOENT') || errorMessage.includes('not found')) {
27 return 'not_found';
28 }
29 if (errorMessage.includes('EACCES') || errorMessage.includes('permission')) {
30 return 'permission_denied';
31 }
32 if (errorMessage.includes('ENOSPC')) {
33 return 'disk_full';
34 }
35 if (errorMessage.includes('npm')) {
36 return 'npm_error';
37 }
38 if (errorMessage.includes('network') || errorMessage.includes('ECONNREFUSED') || errorMessage.includes('ENOTFOUND')) {
39 return 'network_error';
40 }
41 return 'unknown';
42}
43type Props = {
44 isUpdating: boolean;
45 onChangeIsUpdating: (isUpdating: boolean) => void;

Callers 1

NativeAutoUpdaterFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected