| 168 | export type ProjectCommandError = typeof ProjectCommandError.Type; |
| 169 | |
| 170 | export function projectCommandErrorFromLiveServerRequest(cause: unknown): ProjectCommandError { |
| 171 | if (isEnvironmentHttpCommonError(cause)) { |
| 172 | return new ProjectLiveServerDeclaredResponseError({ |
| 173 | operation: "callLiveServer", |
| 174 | code: cause.code, |
| 175 | traceId: cause.traceId, |
| 176 | cause, |
| 177 | }); |
| 178 | } |
| 179 | if (HttpClientError.isHttpClientError(cause) && cause.response !== undefined) { |
| 180 | return new ProjectLiveServerUndeclaredStatusError({ |
| 181 | operation: "callLiveServer", |
| 182 | status: cause.response.status, |
| 183 | cause, |
| 184 | }); |
| 185 | } |
| 186 | |
| 187 | return new ProjectLiveServerRequestError({ operation: "callLiveServer", cause }); |
| 188 | } |
| 189 | |
| 190 | const projectCommandUuid = Crypto.Crypto.pipe( |
| 191 | Effect.flatMap((crypto) => crypto.randomUUIDv4), |