MCPcopy
hub / github.com/desktop/desktop / parseError

Function parseError

app/src/lib/squirrel-error-parser.ts:18–36  ·  view source on GitHub ↗
(error: Error)

Source from the content-addressed store, hash-verified

16 * @param error The underlying error from Squirrel.
17 */
18export function parseError(error: Error): Error | null {
19 if (squirrelMissingRegex.test(error.message)) {
20 return new Error(
21 'The application is missing a dependency it needs to check and install updates. This is very, very bad.'
22 )
23 }
24 if (squirrelDNSRegex.test(error.message)) {
25 return new Error(
26 'GitHub Desktop was not able to contact the update server. Ensure you have internet connectivity and try again.'
27 )
28 }
29 if (squirrelTimeoutRegex.test(error.message)) {
30 return new Error(
31 'GitHub Desktop was not able to check for updates due to a timeout. Ensure you have internet connectivity and try again.'
32 )
33 }
34
35 return null
36}

Callers 3

UpdateStoreClass · 0.90
gitFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected