MCPcopy Create free account
hub / github.com/heygen-com/hyperframes / classifyRuntimeScriptFailure

Function classifyRuntimeScriptFailure

packages/core/src/runtime/init.ts:290–310  ·  view source on GitHub ↗
(
    rawMessage: string,
  )

Source from the content-addressed store, hash-verified

288 };
289
290 const classifyRuntimeScriptFailure = (
291 rawMessage: string,
292 ): {
293 code: string;
294 category: string;
295 } => {
296 const message = rawMessage.toLowerCase();
297 if (
298 message.includes("cannot read properties of null") ||
299 message.includes("cannot set properties of null")
300 ) {
301 return { code: "runtime_null_dom_access", category: "dom-null-access" };
302 }
303 if (message.includes("failed to execute 'queryselector'")) {
304 return { code: "runtime_invalid_selector", category: "selector-invalid" };
305 }
306 if (message.includes("is not defined")) {
307 return { code: "runtime_reference_missing", category: "reference-missing" };
308 }
309 return { code: "runtime_script_error", category: "script-error" };
310 };
311
312 const parseDimensionPx = (value: string | null): string | null => {
313 if (value == null || value.trim() === "") return null;

Callers 1

Calls

no outgoing calls

Tested by

no test coverage detected