(
reply: { send(payload: unknown): unknown },
requestId: string,
err: unknown,
)
| 179 | } |
| 180 | |
| 181 | function sendMappedError( |
| 182 | reply: { send(payload: unknown): unknown }, |
| 183 | requestId: string, |
| 184 | err: unknown, |
| 185 | ): void { |
| 186 | if (err instanceof TerminalNotFoundError) { |
| 187 | reply.send(errEnvelope(ErrorCode.TERMINAL_NOT_FOUND, err.message, requestId)); |
| 188 | return; |
| 189 | } |
| 190 | if (err instanceof SessionNotFoundError) { |
| 191 | reply.send(errEnvelope(ErrorCode.SESSION_NOT_FOUND, err.message, requestId)); |
| 192 | return; |
| 193 | } |
| 194 | if (err instanceof FsPathEscapesError) { |
| 195 | reply.send(errEnvelope(ErrorCode.FS_PATH_ESCAPES_SESSION, err.message, requestId)); |
| 196 | return; |
| 197 | } |
| 198 | throw err; |
| 199 | } |
no test coverage detected