| ... | ... | @@ -1,8 +1,8 @@ |
| 1 | 1 | import * as Cause from "effect/Cause"; |
| 2 | | import * as Data from "effect/Data"; |
| 3 | 2 | import * as Effect from "effect/Effect"; |
| 4 | 3 | import * as Option from "effect/Option"; |
| 5 | 4 | import * as Ref from "effect/Ref"; |
| 5 | import * as Schema from "effect/Schema"; |
| 6 | 6 | |
| 7 | 7 | import * as NetService from "@t3tools/shared/Net"; |
| 8 | 8 | import * as Crypto from "effect/Crypto"; |
| ... | ... | @@ -33,22 +33,24 @@ const makeDesktopRunId = Crypto.Crypto.pipe( |
| 33 | 33 | Effect.map((value) => value.replaceAll("-", "").slice(0, 12)), |
| 34 | 34 | ); |
| 35 | 35 | |
| 36 | | class DesktopBackendPortUnavailableError extends Data.TaggedError( |
| 36 | export class DesktopBackendPortUnavailableError extends Schema.TaggedErrorClass<DesktopBackendPortUnavailableError>()( |
| 37 | 37 | "DesktopBackendPortUnavailableError", |
| 38 | | )<{ |
| 39 | | readonly startPort: number; |
| 40 | | readonly maxPort: number; |
| 41 | | readonly hosts: readonly string[]; |
| 42 | | }> { |
| 43 | | override get message() { |
| 38 | { |
| 39 | startPort: Schema.Int, |
| 40 | maxPort: Schema.Int, |
| 41 | hosts: Schema.Array(Schema.String), |
| 42 | }, |
| 43 | ) { |
| 44 | override get message(): string { |
| 44 | 45 | return `No desktop backend port is available on hosts ${this.hosts.join(", ")} between ${this.startPort} and ${this.maxPort}.`; |
| 45 | 46 | } |
| 46 | 47 | } |
| 47 | 48 | |
| 48 | | class DesktopDevelopmentBackendPortRequiredError extends Data.TaggedError( |
| 49 | export class DesktopDevelopmentBackendPortRequiredError extends Schema.TaggedErrorClass<DesktopDevelopmentBackendPortRequiredError>()( |
| 49 | 50 | "DesktopDevelopmentBackendPortRequiredError", |
| 50 | | )<{}> { |
| 51 | | override get message() { |
| 51 | {}, |
| 52 | ) { |
| 53 | override get message(): string { |
| 52 | 54 | return "T3CODE_PORT is required in desktop development."; |
| 53 | 55 | } |
| 54 | 56 | } |