mirror of
https://github.com/stablyai/orca.git
synced 2026-10-20 00:03:45 +00:00
19 lines
529 B
TypeScript
19 lines
529 B
TypeScript
import type { RuntimeRpcResponse } from '../../shared/runtime-rpc-envelope'
|
|
import { withRemoteRuntimeTailscaleHint } from '../../shared/remote-runtime-tailscale-hint'
|
|
|
|
export function withTailscaleHintForResponse<TResult>(
|
|
response: RuntimeRpcResponse<TResult>,
|
|
endpoint: string
|
|
): RuntimeRpcResponse<TResult> {
|
|
if (response.ok === true) {
|
|
return response
|
|
}
|
|
return {
|
|
...response,
|
|
error: {
|
|
...response.error,
|
|
message: withRemoteRuntimeTailscaleHint(response.error.message, endpoint)
|
|
}
|
|
}
|
|
}
|