Open History to see the last commit
1import { Schema } from "effect";
2
3/**
4 * GitCommandError - Git command execution failed.
5 */
6export class GitCommandError extends Schema.TaggedErrorClass<GitCommandError>()("GitCommandError", {
7 operation: Schema.String,
8 command: Schema.String,
9 cwd: Schema.String,
10 detail: Schema.String,
11 cause: Schema.optional(Schema.Defect),
12}) {
13 override get message(): string {
14 return `Git command failed in ${this.operation}: ${this.command} (${this.cwd}) - ${this.detail}`;
15 }
16}
17
18/**
19 * GitHubCliError - GitHub CLI execution or authentication failed.
20 */
21export class GitHubCliError extends Schema.TaggedErrorClass<GitHubCliError>()("GitHubCliError", {
22 operation: Schema.String,
23 detail: Schema.String,
24 cause: Schema.optional(Schema.Defect),
25}) {
26 override get message(): string {
27 return `GitHub CLI failed in ${this.operation}: ${this.detail}`;
28 }
29}
30
31/**
32 * TextGenerationError - Commit or PR text generation failed.
33 */
34export class TextGenerationError extends Schema.TaggedErrorClass<TextGenerationError>()(
35 "TextGenerationError",
36 {
37 operation: Schema.String,
38 detail: Schema.String,
39 cause: Schema.optional(Schema.Defect),
40 },
41) {
42 override get message(): string {
43 return `Text generation failed in ${this.operation}: ${this.detail}`;
44 }
45}
46
47/**
48 * GitManagerError - Stacked Git workflow orchestration failed.
49 */
50export class GitManagerError extends Schema.TaggedErrorClass<GitManagerError>()("GitManagerError", {
51 operation: Schema.String,
52 detail: Schema.String,
53 cause: Schema.optional(Schema.Defect),
54}) {
55 override get message(): string {
56 return `Git manager failed in ${this.operation}: ${this.detail}`;
57 }
58}
59
60/**
61 * GitManagerServiceError - Errors emitted by stacked Git workflow orchestration.
62 */
63export type GitManagerServiceError =
64 | GitManagerError
65 | GitCommandError
66 | GitHubCliError
67 | TextGenerationError;