/** * Error Handler Factory * * Weniger, aber besser: One error handling pattern for all integrations. * Eliminates ~300 lines of duplicate error handling code. */ import { ActionResult } from '@workwayco/sdk'; /** * Create an error handler bound to a specific integration * * @example * ```typescript * const handleError = createErrorHandler('gmail'); * * // Later in methods: * catch (error) { * return handleError(error, 'send-email'); * } * ``` */ export declare function createErrorHandler(integrationName: string): (error: unknown, action: string) => ActionResult; /** * Assert response is OK, throw IntegrationError if not * * @example * ```typescript * const response = await this.request('/endpoint'); * await assertResponseOk(response, { integration: 'gmail', action: 'get-email' }); * const data = await response.json(); * ``` */ export declare function assertResponseOk(response: Response, context: { integration: string; action: string; }): Promise; /** * Validate that access token is provided * Throws IntegrationError if missing */ export declare function validateAccessToken(token: unknown, integrationName: string): asserts token is string; //# sourceMappingURL=error-handler.d.ts.map