(error: unknown)
| 34 | } |
| 35 | |
| 36 | export function isStructuredError(error: unknown): error is StructuredError { |
| 37 | return ( |
| 38 | typeof error === 'object' && |
| 39 | error !== null && |
| 40 | 'status' in error && |
| 41 | typeof (error as StructuredError).status === 'number' |
| 42 | ); |
| 43 | } |
| 44 | |
| 45 | /** |
| 46 | * A decorator that wraps a ContentGenerator to add logging to API calls. |