(err: unknown, callerContext: unknown)
| 182 | } |
| 183 | |
| 184 | function serviceUnavailable(err: unknown, callerContext: unknown): AdaptedResponse { |
| 185 | const errorObj: Record<string, unknown> = { |
| 186 | code: 'SERVICE_UNAVAILABLE', |
| 187 | message: err instanceof Error ? err.message : 'Unknown error', |
| 188 | recovery: 'transient', |
| 189 | }; |
| 190 | const body = wrapEnvelope({ adcp_error: errorObj }, { context: callerContext }); |
| 191 | return { |
| 192 | isError: true, |
| 193 | content: [{ type: 'text', text: JSON.stringify(body) }], |
| 194 | structuredContent: body, |
| 195 | }; |
| 196 | } |
| 197 | |
| 198 | function versionUnsupported(requested: unknown, callerContext: unknown): AdaptedResponse { |
| 199 | const errorObj: Record<string, unknown> = { |
no outgoing calls
no test coverage detected