1import * as Schema from "effect/Schema";
2
3export class ServerCliCommandExitError extends Schema.TaggedError<ServerCliCommandExitError>()(
4 "ServerCliCommandExitError",
5 {
6 command: Schema.String,
7 args: Schema.Array(Schema.String),
8 cwd: Schema.optional(Schema.String),
9 exitCode: Schema.Int,
10 },
11) {
12 override get message(): string {
13 return `Command exited with non-zero exit code (${this.exitCode})`;
14 }
15}
16
17export class ServerCliDevelopmentIconSourceMissingError extends Schema.TaggedError<ServerCliDevelopmentIconSourceMissingError>()(
18 "ServerCliDevelopmentIconSourceMissingError",
19 {
20 sourcePath: Schema.String,
21 },
22) {
23 override get message(): string {
24 return `Missing development icon source: ${this.sourcePath}`;
25 }
26}
27
28export class ServerCliDevelopmentIconTargetMissingError extends Schema.TaggedError<ServerCliDevelopmentIconTargetMissingError>()(
29 "ServerCliDevelopmentIconTargetMissingError",
30 {
31 targetPath: Schema.String,
32 },
33) {
34 override get message(): string {
35 return `Missing development icon target: ${this.targetPath}. Build web first.`;
36 }
37}
38
39export class ServerCliBuildAssetMissingError extends Schema.TaggedError<ServerCliBuildAssetMissingError>()(
40 "ServerCliBuildAssetMissingError",
41 {
42 assetPath: Schema.String,
43 },
44) {
45 override get message(): string {
46 return `Missing build asset: ${this.assetPath}. Run the build subcommand first.`;
47 }
48}
49
50export class ServerCliExecutableImportError extends Schema.TaggedError<ServerCliExecutableImportError>()(
51 "ServerCliExecutableImportError",
52 {
53 bundlePath: Schema.String,
54 specifiers: Schema.Array(Schema.String),
55 },
56) {
57 override get message(): string {
58 return `${this.bundlePath} imports file-backed packages that a single-executable cannot resolve: ${this.specifiers.join(", ")}. Load them through createRequire instead.`;
59 }
60}