Book a Demo!
CoCalc Logo Icon
StoreFeaturesDocsShareSupportNewsAboutPoliciesSign UpSign In
sagemathinc
GitHub Repository: sagemathinc/cocalc
Path: blob/master/src/packages/util/consts/project.ts
5776 views
1
export const DUMMY_SECRET = `[SECRET HIDDEN]`;
2
3
export const DOC_CLOUD_STORAGE_URL =
4
"https://doc.cocalc.com/project-settings.html#cloud-storage-remote-file-systems";
5
6
export const PROJECT_EXEC_DEFAULT_TIMEOUT_S = 60;
7
8
export const TIMEOUT_CALLING_PROJECT = "timeout";
9
10
export const TIMEOUT_CALLING_PROJECT_MSG =
11
"Timeout communicating with project.";
12
13
/**
14
* Checks if an error represents a timeout when communicating with a project.
15
*
16
* Handles both legacy and conat-based timeout errors:
17
* - Legacy: String "timeout"
18
* - Conat: ConatError with code 408 (HTTP Request Timeout)
19
* See @cocalc/conat/core/client.ts lines 1391, 1937-1939 where 408 timeouts are thrown
20
*/
21
export function isTimeoutCallingProject(err): boolean {
22
if (err === TIMEOUT_CALLING_PROJECT) {
23
return true;
24
}
25
if (err?.constructor?.name === "ConatError" && err?.code === 408) {
26
return true;
27
}
28
return false;
29
}
30
31