Fix remaining console logs and types

This commit is contained in:
gpt-engineer-app[bot]
2025-11-03 20:04:11 +00:00
parent 6fbaf0c606
commit 2cd6b2c6c3
10 changed files with 127 additions and 42 deletions

View File

@@ -1,5 +1,5 @@
import { serve } from "https://deno.land/std@0.190.0/http/server.ts";
import { startRequest, endRequest } from "../_shared/logger.ts";
import { startRequest, endRequest, edgeLogger } from "../_shared/logger.ts";
const corsHeaders = {
'Access-Control-Allow-Origin': '*',
@@ -127,7 +127,10 @@ const handler = async (req: Request): Promise<Response> => {
// Check if domain is disposable
if (DISPOSABLE_DOMAINS.has(domain)) {
console.log(`Blocked disposable email domain: ${domain}`);
edgeLogger.info('Blocked disposable email domain', {
domain,
requestId: tracking.requestId
});
endRequest(tracking, 400, 'Disposable email domain blocked');
@@ -154,7 +157,10 @@ const handler = async (req: Request): Promise<Response> => {
}
// Email is valid
console.log(`Email validated successfully: ${email}`);
edgeLogger.info('Email validated successfully', {
email,
requestId: tracking.requestId
});
endRequest(tracking, 200);
@@ -173,8 +179,12 @@ const handler = async (req: Request): Promise<Response> => {
}
);
} catch (error: any) {
console.error('Error in validate-email function:', error);
} catch (error) {
const errorMessage = error instanceof Error ? error.message : String(error);
edgeLogger.error('Error in validate-email function', {
error: errorMessage,
requestId: tracking.requestId
});
endRequest(tracking, 500, error.message);