(
reply: { send(payload: unknown): unknown },
requestId: string,
err: unknown,
)
| 74 | } |
| 75 | |
| 76 | function sendMappedError( |
| 77 | reply: { send(payload: unknown): unknown }, |
| 78 | requestId: string, |
| 79 | err: unknown, |
| 80 | ): void { |
| 81 | if (err instanceof WorkspaceFsNotAbsoluteError) { |
| 82 | reply.send(errEnvelope(ErrorCode.VALIDATION_FAILED, err.message, requestId)); |
| 83 | return; |
| 84 | } |
| 85 | if (err instanceof WorkspaceFsNotFoundError) { |
| 86 | reply.send(errEnvelope(ErrorCode.FS_PATH_NOT_FOUND, err.message, requestId)); |
| 87 | return; |
| 88 | } |
| 89 | if (err instanceof WorkspaceFsPermissionError) { |
| 90 | reply.send(errEnvelope(ErrorCode.FS_PERMISSION_DENIED, err.message, requestId)); |
| 91 | return; |
| 92 | } |
| 93 | throw err; |
| 94 | } |
no test coverage detected