(
body: Record<string, unknown> | undefined,
)
| 124 | } |
| 125 | |
| 126 | function readRpcError( |
| 127 | body: Record<string, unknown> | undefined, |
| 128 | ): { code?: number; message?: string } | undefined { |
| 129 | const err = asRecord(body?.['error']); |
| 130 | if (err === undefined) { |
| 131 | return undefined; |
| 132 | } |
| 133 | const code = typeof err['code'] === 'number' ? err['code'] : undefined; |
| 134 | const message = typeof err['message'] === 'string' ? err['message'] : undefined; |
| 135 | return { code, message }; |
| 136 | } |
| 137 | |
| 138 | function firstText(result: Record<string, unknown> | undefined): string | undefined { |
| 139 | const content = result?.['content']; |
no test coverage detected