t3-code-android-nightly/apps/server/scripts/cliErrors.ts
Julius Marminge 91cd91c087
feat(release): publish npx t3 as a launcher over per-platform executable packages (#11607)
Co-authored-by: Claude Fable 5 <noreply@anthropic.com>
2026-09-13 21:24:24 -07:00

60 lines
1.8 KiB
TypeScript

import * as Schema from "effect/Schema";
export class ServerCliCommandExitError extends Schema.TaggedError<ServerCliCommandExitError>()(
"ServerCliCommandExitError",
{
command: Schema.String,
args: Schema.Array(Schema.String),
cwd: Schema.optional(Schema.String),
exitCode: Schema.Int,
},
) {
override get message(): string {
return `Command exited with non-zero exit code (${this.exitCode})`;
}
}
export class ServerCliDevelopmentIconSourceMissingError extends Schema.TaggedError<ServerCliDevelopmentIconSourceMissingError>()(
"ServerCliDevelopmentIconSourceMissingError",
{
sourcePath: Schema.String,
},
) {
override get message(): string {
return `Missing development icon source: ${this.sourcePath}`;
}
}
export class ServerCliDevelopmentIconTargetMissingError extends Schema.TaggedError<ServerCliDevelopmentIconTargetMissingError>()(
"ServerCliDevelopmentIconTargetMissingError",
{
targetPath: Schema.String,
},
) {
override get message(): string {
return `Missing development icon target: ${this.targetPath}. Build web first.`;
}
}
export class ServerCliBuildAssetMissingError extends Schema.TaggedError<ServerCliBuildAssetMissingError>()(
"ServerCliBuildAssetMissingError",
{
assetPath: Schema.String,
},
) {
override get message(): string {
return `Missing build asset: ${this.assetPath}. Run the build subcommand first.`;
}
}
export class ServerCliExecutableImportError extends Schema.TaggedError<ServerCliExecutableImportError>()(
"ServerCliExecutableImportError",
{
bundlePath: Schema.String,
specifiers: Schema.Array(Schema.String),
},
) {
override get message(): string {
return `${this.bundlePath} imports file-backed packages that a single-executable cannot resolve: ${this.specifiers.join(", ")}. Load them through createRequire instead.`;
}
}