History

Add Effect-focused Oxlint rules and direct-yield cleanup

Rhys Sullivan committed 8 months ago

Commit 444c8a71 parent 0205ac156 files · +626 −460Browse files

Showing the changes to apps/executor/src/effect-errors.ts (1 of 56 files). Show all

Unified · Split

apps/executor/src/effect-errors.ts+40−0
@@ -0,0 +1,40 @@
1+import * as Data from "effect/Data";
2+
3+export class ExecutorAppEffectError extends Data.TaggedError(
4+ "ExecutorAppEffectError",
5+)<{
6+ readonly module: string;
7+ readonly message: string;
8+}> {}
9+
10+export const executorAppEffectError = (
11+ module: string,
12+ message: string,
13+) => new ExecutorAppEffectError({ module, message });
14+
15+export class LocalServerReachabilityTimeoutError extends Data.TaggedError(
16+ "LocalServerReachabilityTimeoutError",
17+)<{
18+ readonly baseUrl: string;
19+ readonly action: "start" | "shutdown";
20+ readonly logFile: string;
21+ readonly logTail: string | null;
22+ readonly message: string;
23+}> {}
24+
25+export const localServerReachabilityTimeoutError = (input: {
26+ baseUrl: string;
27+ expected: boolean;
28+ logFile: string;
29+ logTail: string | null;
30+}) =>
31+ new LocalServerReachabilityTimeoutError({
32+ baseUrl: input.baseUrl,
33+ action: input.expected ? "start" : "shutdown",
34+ logFile: input.logFile,
35+ logTail: input.logTail,
36+ message:
37+ input.logTail === null
38+ ? `Timed out waiting for local executor server ${input.expected ? "start" : "shutdown"} at ${input.baseUrl}\n\nDaemon log: ${input.logFile}`
39+ : `Timed out waiting for local executor server ${input.expected ? "start" : "shutdown"} at ${input.baseUrl}\n\nRecent daemon log (${input.logFile}):\n${input.logTail}`,
40+ });