MCPcopy Create free account
hub / github.com/Superflows-AI/superflows / parseErrorHtml

Function parseErrorHtml

supabase/functions/execute-code-2/utils.ts:173–189  ·  view source on GitHub ↗
(str: string)

Source from the content-addressed store, hash-verified

171}
172
173export function parseErrorHtml(str: string): string {
174 const elements = [];
175 const regexes = [
176 /<title.*?>(.*)<\/title>/,
177 /<h1.*?>(.*)<\/h1>/,
178 /<h2.*?>(.*)<\/h2>/,
179 /<h3.*?>(.*)<\/h3>/,
180 ];
181 for (const regex of regexes) {
182 const match = str.match(regex);
183 if (match) {
184 elements.push(match[1].trim().replace(/\s+/g, " "));
185 }
186 }
187 const result = elements.filter(Boolean).join("\n");
188 return result.length > 0 ? result : str;
189}
190
191export function formatString() {
192 const args = Array.prototype.slice.call(arguments);

Callers 1

makeHttpRequestFunction · 0.90

Calls

no outgoing calls

Tested by

no test coverage detected