Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 7 additions & 0 deletions supabase/functions/cnpj-lookup/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,13 @@ Deno.serve(async (req) => {
}

const apiKey = Deno.env.get("CNPJA_API_KEY");
if (!apiKey) {
console.error("[cnpj-lookup] CNPJA_API_KEY não configurada");
return new Response(
JSON.stringify({ error: "Serviço de consulta CNPJ não configurado" }),
{ status: 503, headers: { ...corsHeaders, "Content-Type": "application/json" } },
);
}

// CNPJá Commercial API
const response = await fetchWithBreaker(
Expand Down
3 changes: 2 additions & 1 deletion supabase/functions/simulation-orchestrator/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -218,7 +218,8 @@
status: 200,
});
} catch (error) {
return new Response(JSON.stringify({ error: error.message }), {
const errorMessage = error instanceof Error ? error.message : String(error);
return new Response(JSON.stringify({ error: errorMessage }), {

Check warning

Code scanning / CodeQL

Information exposure through a stack trace Medium

This information exposed to the user depends on
stack trace information
.
headers: { ...corsHeaders, "Content-Type": "application/json" },
status: 400,
});
Expand Down
3 changes: 2 additions & 1 deletion supabase/functions/sync-external-db/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,8 @@

} catch (error) {
console.error("Sync error:", error);
return new Response(JSON.stringify({ error: error.message }), {
const errorMessage = error instanceof Error ? error.message : String(error);
return new Response(JSON.stringify({ error: errorMessage }), {

Check warning

Code scanning / CodeQL

Information exposure through a stack trace Medium

This information exposed to the user depends on
stack trace information
.
status: 500,
headers: { ...corsHeaders, "Content-Type": "application/json" },
});
Expand Down
Loading