(cause: unknown, message: string)
| 147 | effect.pipe(Effect.mapError((cause) => accountErrorFromCause(cause, message))) |
| 148 | |
| 149 | const accountErrorFromCause = (cause: unknown, message: string): AccountError => { |
| 150 | if (cause instanceof AccountServiceError || cause instanceof AccountTransportError) { |
| 151 | return cause |
| 152 | } |
| 153 | |
| 154 | if (HttpClientError.isHttpClientError(cause)) { |
| 155 | switch (cause.reason._tag) { |
| 156 | case "TransportError": { |
| 157 | return AccountTransportError.fromHttpClientError(cause.reason) |
| 158 | } |
| 159 | default: { |
| 160 | return new AccountServiceError({ message, cause }) |
| 161 | } |
| 162 | } |
| 163 | } |
| 164 | |
| 165 | return new AccountServiceError({ message, cause }) |
| 166 | } |
| 167 | |
| 168 | export interface Interface { |
| 169 | readonly active: () => Effect.Effect<Option.Option<Info>, AccountError> |
no test coverage detected